| | |
Starers Script
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
I got bored and started some scripting the other day in PHP, this is just a sample that i wrote, just uncomment the part of script that you would like to see. IE remove the /* and */ around a certain area. i know its not great, but some beginners might find this a little helpful.
<?php ///////////////////////////////////////////////////// //Block of code is testing for a switch, to view //// //the test just remove the /* and */ and the //////// //begining and ending of this code block///////////// ///////////////////////////////////////////////////// /* echo "The expression x <= 3 while x=1 is to be evaluated <br />"; echo "The values of x are to be printed using a case switch <br />"; for($x = 1; $x <= 3; $x++) { switch ($x) { case 1: echo "Number is "; echo $x; echo "<br />"; break; case 2: echo "Number is "; echo $x; echo "<br />"; break; case 3: echo "Number is "; echo $x; echo "<br />"; break; default: echo "Numbers is not between 1 and 3 <br />"; break; } } */ /* ///////////////////////////////////////////////// //Will print the vallues of a given array//////// ///////////////////////////////////////////////// $arr=array("one", "two", "three"); foreach ($arr as $value) echo "Value: " . $value . "<br />"; */ ///////////////////////////////////////////////// //Code to output where the user came from and//// //The IP along with their Browser Version//////// ///////////////////////////////////////////////// /* echo "Referer: " . $_SERVER['HTTP_REFERER'] . "<br />"; echo "Browser: " . $_SERVER['HTTP_USER_AGENT'] . "<br />"; echo "IP Add: " . $_SERVER['REMOTE_ADDR'] . "<br />"; */ ////////////////////////////////////////////////// //Testing the fopen() function//////////////////// ////////////////////////////////////////////////// /* $f=fopen ("welcome.txt","r+"); */ /* if (!($f=fopen("welcomez.txt","r"))) exit ("unable to open file!"); */ ?>
Similar Threads
- plz explain me wht does this script means.It is a perl script. (Perl)
- Windows Script Host question (WSH logon script) (Windows NT / 2000 / XP)
- How can we include a clientside script like Java script (ASP.NET)
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla jquery js limit link login loop mail mediawiki menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select server sessions sms soap source space speed sql stored structure subdomain syntax system table tutorial update updates upload url validation validator variable video web xml youtube



