Hello everyone,
I wanted to see if anyone can help. I want to create a web page form that submits to itself, and make a php program use the isset function and the PHP_SELF.
ex. i will use the isset function to tell when a form submission has occured, and if a form submission has not occured, make the program display a form asking for the user's first and last name (but not the answer), and if a from submission has occured, make the program display the answer ( first & last name) but not the form.
I'm trying to use PHP_SELF as a variable to make the form submit back to itself.
this is what i have done so far
This is the web page & php code,
<html>
<head></head>
<body>
<form method ="GET" action="think.html">
First Name
<input name = "FirstName" type="text">
Last Name
<input name = "Lname" type="text">
<BR>
<BR>
<input type ="hidden" name= "hidden" value="PHP_SELF">
<input type ="submit">
<input type ="hidden">
<BR>
</html>
<html>
<?php
if (isset(submit)){
echo " my first name is $GET[FirstName] and Last name is $GET[Lname]";
} elseif (isset(!submit)){
$PHP_SELF="http://localhost/MyEx/think.html";
}
?>
</form>
</body>
</html>