Problem using isset
Posted: Tue May 11, 2004 1:45 pm
I would like some help on an ecommerce site I'm working on. List below are the HTML code and PHP code I'm dealing with. There are two buttons: Buy Now and Finance, which should go to different places (see PHP code) when the user clicks on them. However, currently, both are going to the "else" place in financing.phtm. I should say at the outset that this code worked on another website (I took over from a previous web developer) this company uses (both HTML and PHP). I'm lost. An FYI question, do the isset variables get set anywhere other than in the PHP file? Thanks in advance for any help.
HTML:
PHP (financing.phtml):
HTML:
Code: Select all
<form action="financing.phtml" method="post">
<input type="hidden" name=productї] value="Big Stuff">
<input type="hidden" name=price value= "195.00">
<input type="hidden" name=units value="0">
<table border="2" cellpadding="5"
cellspacing="0" style=
"border-collapse: collapse">
<tr>
<td>
<font face="Trebuchet MS">
</font> <b>Big Stuff<br />
<font size="2">Retail
<strike>$230.00</strike><br />
Wholesale $202.00<br /></font>
<font size="2" color="#FF0000">Sale
Price * $195.00</font><br />
<font face="Trebuchet MS">
<select size="1" name="productї]1">
<input type=image src="images/buynow.jpg" value="Buy Now" alt="Buy Now" width="80" height="24">
<font face="Trebuchet MS">
<br />
<font color="#336600" size=
"2">Standard Package</font><font color="#336600">
</font>
</b>
</center>
</td>
<td bgcolor="#CCFFCC">
<b><font size="2">
$97.83/mo.</font></b><br />
<input type="image" value="Finance"
src="images/finance.jpg" alt="Finance"
width="80" height="24"><br />
<font size=
"2"><b>48 </b></font><b><font size=
"2">months</font></b> </td>
</tr>
</table>
</form>Code: Select all
if (isset($BuyNow_x) || ($submit == "Buy Now") || isset($BuyNow))
{
if (is_array($product))
$product = implode(", ", $product);
header("Location: http://ww7.aitsafe.com/cf/add.cfm?useri ... its=$units");
exit;
}
else
{
if (is_array($product))
$product = implode(", ", $product);
header("Location: https://www.securewebexchange.com/diamo ... ice=$price");
exit;
}