Showing a users IP address is very easy. We use a function called getenv ( ) to do so. Here is the code: <?php echo getenv('REMOTE_ADDR'); ?> Simple as that… Heres a demo please wait...Rating: 9.1/10 (7 votes cast)
Continue reading...Wednesday, November 5, 2008
In this tutorial Im going to show you how to make a random advert rotator. The way we are going to do it is through an array to define our adverts then use an array function to shuffle the array. So the first thing we need to create the array… $adverts=array('<a href="http://www.website.com"><img src="image.gif" alt="" /></a>'=>'1','<a href="http://www.website.com"><img src="image.gif" alt="" [...]
Continue reading...Saturday, November 1, 2008
Connecting to a MySQL database in PHP is very simple. People seem to be under the impression its very complicated. To connect to a database firstly we need to connect to MySQL using this function: mysql_connect ( ) Here is the syntax for this: mysql_connect('localhost', 'mysql_user', 'mysql_password') A slightly more advanced way of doing this is using this. It [...]
Continue reading...
Friday, November 7, 2008
3 Comments