[RESOLVED] PHP newbie help
Hi everyone,
I am sort of new to PHP and i have a few questions... :wave:
1. $_SESSION["cart"] is supposed to be an array which holds an array variable which in the code its supposed to be $arow...
is there anything wrong with this code?
Code:
$arow = array($id, $qty, $prc);
if(isset($_SESSION["cart"]))
{
$found = 0;
foreach($_SESSION["cart"] as $value)
{
if($id == $value[0])
{
$found = 1;
}
}
if($found == 0)
{
count++;
$_SESSION["cart"][] = $arow;
}
}
else
{
$count = 1;
$_SESSION["cart"][] = $arow;
}
2. When having a link, or a button, how does one go about so that a php function is called when that button is pressed or link is clicked ?
Thanks in advanced :)
Re: [RESOLVED] PHP newbie help
visualAd, thanks...
I finally got it to work, I did have to use what you told me to use... <a href="page.php?id=1&var2=2"> and from then I redirect it back to the page I was using $HTTP_REFERER