Hello everyone. I have 5 google wave invitations that I am going to give away to the people that email me the best 5 php tutorials at admin@erunways.com. Only the 5 selected tutorials will be posted on erunways and the authors will be given credit for it and a link to their site. Please email me the tutorial and you email where you want the invitation to be send to. Please post questions as comments and only email tutorials. Thank you and good luck! ~Admin
PHP + JavaScript System Info >> Simple script to provide information about the site visitor
This is a simple script that provides information about the site visitor.
* What version of JavaScript the vistor browser supports
* Visitor IP Address
* Visitor Hostmask
DEMO at erunways.com/ip

PHP JAVASCRIPT SYSTEM INFO
PHP Simple Timers >> Time any script, file upload and much more with PHP
This is an example of how to use the php time() function. With this you can time anything that takes place between the time() functions. You can see the demo HERE.
$startTimer = time();
// Here you can have anythin you want to be timed
// In this example I have a FOR loop but you dont need it
for ( $counter = 10; $counter <= 100000000; $counter += 10) {
}
$stopTimer = time();
$timerDuration = $stopTimer - $startTimer;
echo "It took $timerDuration sec to display this page."

PHP SIMPLE TIMERS
SMARTY Count Words >> An example of how you can use count_words function to count the number of words in a string with SMARTY
This is an example of you can use the count_words function in SMARTY to count the number of words in a variable. DEMO
<html>
<body>
"{$displayText}" has {$displayText|count_words} words.
</body>
</html>

SMARTY Count Words
SMARTY show ODD and EVEN items with a SMARTY LOOP
Here is an example of how to use SMARTY LOOP to show even and odd items. This could be modified to do much more but it is supposed to serve as a simple example. The variable $smarty.section.c_list.index is the real key which is variable that keeps track of the loop counter. Here you can find a demonstration of what the script does DEMO
Here is the code:

SMARTY ODD EVEN LOOP
UNIX how to remove a folder containing other folders and files
I found this to be the best way to delete a folder containing other folders and files. The following command wipes out everything . In some cases you may need to be root. If that is the case type this first:
sudo su
After you have become root if you had to, type the following command:
rm -rf folderName
folderName is the name of the folder.
Hope this helps!
How to use SMARTY variables in JavaScript
This is a simple example of how to use Smarty variables in JavaScript.
{literal}
<script>
$(window).load(function() { var sample='/sample.php?v=<strong>{/literal}{$smarty_variable}{literal}</strong>'; });
</script>
{/literal}





