kbios
asked on
How do I get a PHP to run from HTML?
I have an HTML menu where the menu items are an unnumbered list. Here is one of the list items:
<li><a href="verifycart.php?ukey= 12345">Ver ify Cart</a></li>
When I select this option from the menu the verifycart.php code executes. BUT, the variable is NOT passed. Question 1 - How do I pass data/variable to the PHP from here?
Here is the .php code:
<?php
error_reporting(E_ALL);
include ("config.inc.php");
$ukey = htmlspecialchars(trim($_PO ST['ukey'] ));
$ukey="12345";
$conn = mysql_connect("localhost", "X", "Y.") or die('Verify DB Failure ' . mysql_error());
mysql_select_db("test");
$result = mysql_query("SELECT * FROM itemhdr WHERE itemhdr.ukey = '$ukey'");
if (!$result) {
die('QUERY ERROR: verifyupload ' . mysql_error());
}
$row = mysql_fetch_assoc($result) ;
$vcount = $row['verifycount'];
echo "INSIDE PHP " .$ukey;
echo "|";
echo "VCOUNT " .$vcount;
mysql_close($conn);
?>
Question 2 - Why doesn't $ukey get set via the POST?
Thanks in advance for your help.
<li><a href="verifycart.php?ukey=
When I select this option from the menu the verifycart.php code executes. BUT, the variable is NOT passed. Question 1 - How do I pass data/variable to the PHP from here?
Here is the .php code:
<?php
error_reporting(E_ALL);
include ("config.inc.php");
$ukey = htmlspecialchars(trim($_PO
$ukey="12345";
$conn = mysql_connect("localhost",
mysql_select_db("test");
$result = mysql_query("SELECT * FROM itemhdr WHERE itemhdr.ukey = '$ukey'");
if (!$result) {
die('QUERY ERROR: verifyupload ' . mysql_error());
}
$row = mysql_fetch_assoc($result)
$vcount = $row['verifycount'];
echo "INSIDE PHP " .$ukey;
echo "|";
echo "VCOUNT " .$vcount;
mysql_close($conn);
?>
Question 2 - Why doesn't $ukey get set via the POST?
Thanks in advance for your help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks.
I have a followup question that I will be posting in a minute.
I have a followup question that I will be posting in a minute.
ASKER