Web Designing WAP development EWAVEZ Web Designs Software Development EWAVEZ Home About Us Contact Us PHP Tutorial
Multimedia
Web Development  
Web Hosting
Multimedia development
Software Development
Web Solutions
Our Clientele
     
 
 

PHP-Tutorial

 
 

Variables In A Form

First you make a regular HTML form page, like we learnt here:
 
<form action="form.php" method="post">
Your name: <input type="text" name="name"><br>
Your age: <input type="text" name="age"><br>
<input type="submit">
</form>


This form consists of two text boxes, one which is called "name" and another which is called "age". These names are our variables. We save this file as "form.html", but notice on the first line how the form points to a file called "form.php"? Well, that is a seperate file, consisting of this PHP code:
 
Hi <?php print $name; ?>.
You are <?php print $age; ?> years old.

Other Basics

Other basics include if statments:
if ($x==1) {
// if x equals 1 then run this :o
}

and while:
while ($x==1) {
// while x is still equal to 1 , run!
}

Will run forever - as $x is always 1!
 

One more for now, for:
for ($i=0;$i<100;$i++) {
print "We are $i<br>";
}

Will print "We are " then the nth time its dont it (minus 1 cus it starts from 0) like:

We are 0
We are 1
We are 2
...
We are 99
 
Previous Index Next
 
 
 

EWAVEZ Web Designs. Copyright © 2004 All Rights Reserved

| Home | About Us | Contact Us | Terms & Policies | Hosting | Multimedia | Web Designing | Software | Our Clients

 Search