RE: [PHP-DB] Submit - Retreive
| From: | Jeroen ten Berge | Date: | Thu, 07 Sep 2000 13:23:21 +0000 |
| Subject: | RE: [PHP-DB] Submit - Retreive | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-2690@lists.php.net to get a copy of this message | ||
If you get a post, you can use all value's from that post in your following
page, here's how I used it :
This is on the bottom of my PHP script :
<title>no</title>
<FORM METHOD="POST" NAME="frmIndex" ACTION="<? echo $PHP_SELF;
?>">
<body>
<p align="center"><img border="0" src="images/logo.gif"
width="307"
height="66"></p>
<p align="center">Text</p>
<p>This page is for authorised dealers only. For more information send an
Email to <a href="mailto:not@home.com">not@home.com</a>
<div align="center">
<table border="0" width="31%" cellspacing="0"
cellpadding="0">
<tr>
<td width="55%">
<p align="left">Login ID:</p>
</td>
<center>
<td width="51%">
<p><input type="text" name="txtLoginName"
size="20"></p>
</td>
</tr>
</center>
<tr>
<td width="55%">
<p align="left">Login Password:</p>
</td>
<center>
<td width="51%">
<p><input type="password" name="txtPassword"
size="20"></p>
</td>
</tr>
</table>
</center>
</div>
<p align="center"><input type="submit" value="Login"
name="LoginPost"></p>
</FORM>
<p>For all other inquiries visit <a
href="http://www.not4u.com">www.not4u.com</a></p>
</body>
This is a part elsewhere in the script :
if (($REQUEST_METHOD=='POST'))
{
if (isset ($HTTP_POST_VARS["LoginPost"]))
{
if ($txtLoginName && $txtPassword)
{
include ("main.php");
$strTemp = ValidateUP ($txtLoginName,$txtPassword);
if ($strTemp<>"Logon succesfull")
{
echo "<html><head><meta http-equiv=\"Content-Language\"
content=\"en-us\">";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html;
charset=windows-1252\">";
echo "<title>$strTemp!</title>";
echo "</head><body>";
echo "<p align=\"center\"><img border=\"0\"
src=\"images/logo.gif\"
width=\"307\" height=\"66\"></p>";
echo "<div align=\"center\">";
echo "<FONT color=red>This Login ID is not recognised or you do not
have permission to log on!</FONT>";
echo "</center></div></FORM></body></html>";
exit;
}
else
{
if (!$HTTP_COOKIE_VARS["Koekje"])
{
MakeCookie($txtLoginName);
}
echo "<html><head><meta http-equiv=\"Content-Language\"
content=\"en-us\">";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html;
charset=windows-1252\">";
echo "<title>$strTemp!</title>";
echo "</head><body>";
echo "<p align=\"center\"><img border=\"0\"
src=\"images/logo.gif\"
width=\"307\" height=\"66\"></p>";
echo "<p align=\"center\">Blablabla</p>";
echo "<FORM METHOD=\"POST\" NAME=\"frmCmdBla\"
ACTION=\"$PHP_SELF\">";
echo "<p><center><input type=\"submit\" size=30
value=\"Menuitem1\"
name=\"menuitem1\"></p>";
echo "</FORM><FORM METHOD=\"POST\" NAME=\"frmCmdLookup\"
ACTION=\"$PHP_SELF\">";
echo "<p><center><input type=\"submit\" size=30
value=\"Menuitem2\"
name=\"Menuitem2\"></p>";
echo "</FORM>";
echo "<FORM METHOD=\"POST\" NAME=\"frmCmdReprintBOT\"
ACTION=\"$PHP_SELF\">";
echo "<p><center><input type=\"submit\" size=30
value=\"Reprint
Blabla\" name=\"cmdReprint\"></p>";
echo "</FORM><FORM METHOD=\"POST\" NAME=\"frmLogout\"
ACTION=\"$PHP_SELF\">";
echo "<p><center><input type=\"submit\" size=30 value=\"Log
out\"
name=\"cmdLogout\"></p>";
echo "</center></div></FORM></body></html>";
exit;
}
}
}
if (isset($HTTP_POST_VARS["cmdMain"]))
{
setcookie("Koekje",$HTTP_COOKIE_VARS["Koekje"],time()+3600,"/");
echo "<html><head><meta http-equiv=\"Content-Language\"
content=\"en-us\">";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html;
charset=windows-1252\">";
echo "<title>$strTemp!</title>";
echo "</head><body>";
echo "<p align=\"center\"><img border=\"0\"
src=\"images/logo.gif\"
width=\"307\" height=\"66\"></p>";
<..snip
snip ..>
echo "</center></div></FORM></body></html>";
exit;
}
}
De string of the name of the button will be availlable when pressed, so if
this variable is set you can run a function then which shows your new page
with all the posted variables...
-----Original Message-----
From: Shannon Doyle [mailto:shannon@bigblue.net.au]
Sent: Thursday, September 07, 2000 14:42
To: php-db@lists.php.net
Subject: [PHP-DB] Submit - Retreive
I have a small problem with getting something to work with PHP/MYSQL
Here is the situation:
I have a page that is dynamically generated by a php/mysql call. The
page is
filled with select boxes, each named dynamically as well. What I am now
needing to do is to submit the selected values of these fields onto
another
page (easily done witha form)
However, the following page needs to do a mysql query based on the
information submitted to it by the previous page (collect a value
(price) via a product number), do some calculations and then display the
contents of the select boxes and the results of the calculation.
While I can do the calculation stuff via php, and the displaying of the
contents. What I can't seem to get my head around is how am I going to
script the php calc/query etc based on the fact that the information
coming from the previous page could be different each time it is
submitted. ie, the names of the select fields will change.
Not every one of the fields would be filled out on every occasion.
Can anyone help me out here??
kind regards,
- Shannon
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net