Jump to content

TheJoey

Members
  • Posts

    334
  • Joined

  • Last visited

    Never

Everything posted by TheJoey

  1. Fatal error: Using $this when not in object context in C:\xampplite\htdocs\SHOPPINGCART EXAMPLES\ppal\functions\functions.php on line 59 i doesnt seem to be able to grab the total cost from the other page.
  2. thank you yer i wasnt sure about how to go about it.
  3. im trying to write a function for my shopping cart so i can output totalcost in my order form. function GetTotal() { return $this->totalsub() + $this->shipping(); } that's the function im using at the moment, how can i make it so, i can store it in a variable for latter use, unless i echo the whole function
  4. yeh its on the same domain. So i just add session_start(); to top of my script to continue to session right?
  5. hi i have a question. I have a working cart that uses sessions if i want to send that information over to a order form would i use sessions or $_POST & $_GET?
  6. Lmfao thank you i fill so stupid.
  7. could i do it this way? $_SESSION["cart"] = array( array("item1", ), array("price", 0.75 ), array("quantity", 2) ); array( array("item2", ), array("price", 1.75 ), array("quantity", 3) );
  8. hi im getting this error, and when i tried googling it it said something about using to many '' and "" but im just following a tutorial. foreach(get_xml_catalog() as $product) { $output .= ' <td> <h2>' .$product->title '</h2> <div> <img src="'.$product->img.'" height="100" width="80" /> <span> '.$product->description.' </span> </div> <div class="price"> '.$product->price.' </div> <div class="addToCart"> <a href="#"> add to cart </a> </div> </td>'; } thats were the errors are showing up line 30 being <img src="'.$product->img.'" height="100" width="80" />
  9. how is it possible to store so much information in a single array?
  10. Is there another way i can go about doing a databaseless shopping cart?
  11. i was thinking something like <input name="pid" type="hidden" id="pid" value="<?=$_REQUEST['item1']?>" /> <input name="add_to_cart" type="submit" alt="Add to Cart" class="" id="add_to_basket" value="Add to Cart" /> <input name="pid" type="hidden" id="pid" value="<?=$_REQUEST['item2']?>" /> <input name="add_to_cart" type="submit" alt="Add to Cart" class="" id="add_to_basket" value="Add to Cart" />
  12. Hi im having the problem trying to implement quanity into my shopping cart that uses sessions and arrays <?php session_start(); if(!isset($_SESSION['shop'])) { $_SESSION['shop'] = array(); } // Adding to Cart: if(isset($_GET['action']) && $_GET['action'] == "add_to_cart") { $_SESSION['shop'][] = $_GET['item']; } // Removing From Cart: if(isset($_GET['action']) && $_GET['action'] == "remove_item") { unset($_SESSION['shop'][$_GET['itemkey']]); } ?> <?php echo "<b>Shopping Cart</b><br />"; foreach($_SESSION['shop'] as $key => $value) { echo $value . " <a href='" . $_SERVER['PHP_SELF'] . "?action=remove_item&itemkey=" . $key ."'>Remove</a><br />"; } ?> <a href='<?PHP echo $_SERVER['PHP_SELF']; ?>?action=add_to_cart&item=itemprodid1'>item1/a><br /> <a href='<?PHP echo $_SERVER['PHP_SELF']; ?>?action=add_to_cart&item=itemprodid2'>item2</a><br /> <tr><td>Qty:</td><td><input type="text" name="qty"> the only problem is i dont know how i would add this so that i can latter retrieve it for use for my cart latter
  13. Thank you so much works a treat.
  14. Hey Guys, Just wondering if i had a database that stored information of users that partipate in a poll. The question i have is what is the basics for writing a SQL querry to find out the registered users who have not voted in the poll. Just wondering if this can be done.
  15. nvm worked it out you pointed me in the right directions thanks
  16. But then that places my shopping cart in my banner area of the page..
  17. what if im including this like <html> <body> <?php include('session.php'); </body> </html>
  18. im getting this error Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampplite\htdocs\mellow-yellow\sub_direct\cart.php:41) in C:\xampplite\htdocs\mellow-yellow\sub_direct\cartinc.php on line 6 session_start(); this is line 6. i think the session is still continuing from my login.
  19. thank you so much. so stupid of me thought i closed the table off. thanks.
  20. no its just code which process a form. i just want the style sheet from my html code to take place is that possible?
  21. sorry just forgot to add it even when i do this it shows up its just shows up in the wrong place. and stuffs up all my style from css.
  22. im having trouble displaying my php & html code effeciently i want the code to show in the css but its stuffing everything up. my code is pretty much along these lines <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Layout 2</title> <link rel="stylesheet" href="style.css" type="text/css" media="all" /> </head> <body> <div id="wrapper"> <div id="header"> <div id="nav"> <ul> <li><a href="link.php">link</a></li> </ul> </div> </div> <div id="content"> <div id="right"> <h1>blah blah</h1> <p> <?php include('process.php'); </p> </div> <div class="welcome"> <p> Login box </p> <small><a href="">Forgotten password</a> | <a href="">Register</a></small> </div> <br class="clear"> </div> <div id="footer"> <img src="toooter.gif"></div> </div> </body> </html> where <?php include('process.php'); is were i want my form from my php page to show up.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.