Results 1 to 11 of 11

Thread: [RESOLVED] PHP newbie help

Threaded View

  1. #1

    Thread Starter
    Addicted Member Osiris's Avatar
    Join Date
    Oct 2000
    Location
    Dimension Hole
    Posts
    142

    [RESOLVED] PHP newbie help

    Hi everyone,
    I am sort of new to PHP and i have a few questions...

    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
    Last edited by Osiris; Aug 19th, 2005 at 09:06 PM.
    ؊Ϯϊ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width