Page 1 of 1
Page Control
Posted: Thu Sep 28, 2006 2:02 pm
by OldManRiver
All,
Trying to read through all the manual to determine how control is returned to the calling page for the following scenario:
Code: Select all
<form method=post action=myproc.php>
without using the
in the myproc.php file.
OMR
Posted: Thu Sep 28, 2006 3:14 pm
by feyd
Since I don't really see a question, I'll assume it's "how do I do ...?"
In which case, myproc.php would output the form again. I'll guess that the form is not in myproc.php, so you may be able to use
file_get_contents(), or possibly
include().
Posted: Thu Sep 28, 2006 3:39 pm
by OldManRiver
All,
Actually the form is in the mypage.php file and I have
used both the require statment and the action in the form to call the
myproc.php file.
What the problem is, I can not get the vars to return, regardless of whether I use
the global statement for the vars I need to see or not.
It is a simple login process and I need to show the fields and login on first pass
and the results from the DB query (Welcome vs. Failed) on second pass.
Can't get the passes or var exchange to work correctly!
Do not want to use $_PHP_SELF for security reasons, unless you can show me
a good way to secure it.
OMR
Posted: Thu Sep 28, 2006 3:51 pm
by a94060
you can always put the validation on another page,so that you can bypass you "security reasons" and then get it over there by using the $_POST['var'] array.
Posted: Thu Sep 28, 2006 3:54 pm
by feyd
The general way to refill the form with the submitted content is roughly:
Code: Select all
echo '<input type="text" value="' . $value . '" />';
or something similar.
What I have
Posted: Thu Sep 28, 2006 4:40 pm
by OldManRiver
What I have is:
First Pass:
Code: Select all
$display_block = "<form action='../scripts/login.php' method='POST'><p><strong>User Login:</strong><br>
<INPUT TYPE='text' NAME='username'></p><p><strong>Password:</strong><br>
<INPUT TYPE='password' NAME='password'></p><p> <br>
<input type=image src='../Images/btn-pale(log).jpg' name=log value=log width=120>
</form>";
Second Pass with Success:
Code: Select all
$display_block = "<font size=-1><b>Welcome $f_name $l_name.
<br>Thank you for logging in!</b></font>";
Second Pass with Failure:
Code: Select all
$display_block = "<font size=-1><b>Login not successful!</b></font>";
The $display_block sets on first pass, but does not set on second. When I use
header it sees the runs as first pass and resets everything, so can not get the transfer.
Should be simple, but it isn't.
OMR