Hi All,
Im starting to work with writing functions and am having problems seeing the parameters (i.e. Values of names of html input boxes) from one PHP script to another)
I have it working in a simple script, but is different to the way the book I have says it SHOULD be done.
This script cannot see any of the inputs, E.g. Uname, Passwd, enter, even though I can see then in the address when I run the program. The book I have says I sould be able to access them by for example $Uanme, $Passwd and $enter.
Here what I have.
login.php
<?php
require("function.php");
echo $Uname;//was trying to get these to print
echo $Passwd;//
if (!$enter){
login_page();//This does call the login.php
}
if ($enter == "submit"){
echo "Do Something";//I can never get the value for submit back.
}
?>
And in the "function.php" that it calls
function login_page(){
print "<html>";
print "<head>";
print "<title>Login</title>";
print "</head>";
print "<body>";
print "<form>";
print "<FORM METHOD=\"post\" ACTION=\"login.php\">";
print "Enter Username: <input type=\"text\" name=\"Uname\" />";
print "enter Password: <input type=\"text\" name=\"Passwd\" />";
print "<input name=\"enter\" type=\"submit\" value=\"submit\">";
print "</form>";
print "</body>";
print "</html>";
}
All answers greatfully received.
Thanks!
Gaz.🙂