Submitting the html form to the same page

This scripts tells how to submit a form to the same page itself….

<form method=post action=”<?php echo $_SERVER['PHP_SELF']; ?>”>
Enter your Name: <input type=text name=user>
<input type=submit name=submit>
</form>
<?php
if(isset($_POST['submit']))
{
$user=$_POST['user'];
echo “Welcome Mr. $user”;
}
?>

Comments

Popular Posts