Привет ребят, я с пхп только два дня общаюсь поэтому сильно не бейте. Я вот тут начал делать скриптик:
HTML |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Story script</title> <h1> <P align="center"><font face="Courier New">Please fill out following form </h1></P align></font> </head> <body> <form action= "story.php" method="post"> <p> <font size="5" color="blue" face="Arial Narrow"><P align="center"><b>THE FORM</b> </p> </font> <p><b><P align="center">Your Name:</b> <input type="text" size="4" name="name"></P align></p> <p><b><P align="center">Your Age:</b> <input type="text" size="4" name="age"></P align></p> <p><p align="center"><b>Gender</b>: <select name="Gender"></p></P align> <option value="Male">Male</option> <option value="Female">Female</option></select> <p><b><P align="center">Car:</b> <input text="text" size="4" name="car"></P align></p> <p><P align="center"><input type="Submit"/></p> </P align> </form> </body> </html> |
PHP |
<?php |
PHP |
if ( strlen($age)>2 || !is_int($age) ) { |
PHP |
echo "<p>So you are $age? Nice Age!</p>"; |
PHP |
if ($car == null) { |
HTML |
<select name="Gender"></p></P align> <option value="Male">Male</option> <option value="Female">Female</option></select> |
PHP |
If ($gender == "male") { |
PHP |
<?php |
HTML |
<html> <head> <title>Story script</title> <h1> <P align="center"><font face="Courier New">Please fill out following form </h1></P align></font> </head> <body> <form method="post"> <p> <font size="5" color="blue" face="Arial Narrow"><P align="center"><b>THE FORM</b> </p> </font> <p><b><P align="center">Your Name:</b> <input type="text" size="25" name="name"></P align></p> <p><b><P align="center">Your Age:</b> <input type="text" size="25" name="age"></P align></p> <p><p align="center"><b>Gender</b>: <select name="gender"> <option value="male">Male</option> <option value="female">Female</option> </select> <p><b><P align="center">Car:</b> <input text="text" size="25" name="car"></P align></p> <p><P align="center"><input type="Submit" name="go"/></p> </P align> </form> </body> </html> |