Last active
September 11, 2016 19:49
-
-
Save 08shubhamjindal/ff75328f9f1702b45e6968c053ddc6ef to your computer and use it in GitHub Desktop.
post method in php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>PHP Form Validation</title> | |
</head> | |
<body> | |
<?php | |
$name = $email = $gender = $comment = $website = ""; | |
if ($_SERVER["REQUEST_METHOD"] == "POST") { | |
$name = ($_POST["name"]); | |
$email = ($_POST["email"]); | |
$website =($_POST["website"]); | |
$comment =($_POST["comment"]); | |
$gender =($_POST["gender"]); | |
} | |
?> | |
<form method = "post" action = "game.php"> | |
<table> | |
<tr> | |
<td>Name:</td> | |
<td><input type = "text" name = "name"></td> | |
</tr> | |
<tr> | |
<td>E-mail:</td> | |
<td><input type = "text" name = "email"></td> | |
</tr> | |
<tr> | |
<td>Specific Time:</td> | |
<td><input type = "text" name = "website"></td> | |
</tr> | |
<tr> | |
<td>Class details:</td> | |
<td><textarea name = "comment" rows = "5" cols = "40"></textarea></td> | |
</tr> | |
<tr> | |
<td>Gender:</td> | |
<td> | |
<input type = "radio" name = "gender" value = "female">Female | |
<input type = "radio" name = "gender" value = "male">Male | |
</td> | |
</tr> | |
<tr> | |
<td> | |
<input type = "submit" name = "submit" value = "Submit"> | |
</td> | |
</tr> | |
</table> | |
</form> | |
<?php | |
echo "<h2>Your Given details are as :</h2>"; | |
echo $name; | |
echo "<br>"; | |
echo $email; | |
echo "<br>"; | |
echo $website; | |
echo "<br>"; | |
echo $comment; | |
echo "<br>"; | |
echo $gender; | |
?> | |
<?php if($name=="name") : ?> | |
"<a href="game1.php" target="_blank">play game</a>"; | |
<?php endif; ?> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment