
TheJoey
Members-
Posts
334 -
Joined
-
Last visited
Never
Everything posted by TheJoey
-
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.
-
thank you yer i wasnt sure about how to go about it.
-
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
-
yeh its on the same domain. So i just add session_start(); to top of my script to continue to session right?
-
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?
-
[SOLVED] unexpected T_CONSTANT_ENCAPSED_STRING
TheJoey replied to TheJoey's topic in PHP Coding Help
Lmfao thank you i fill so stupid. -
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) );
-
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" />
-
how is it possible to store so much information in a single array?
-
Is there another way i can go about doing a databaseless shopping cart?
-
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" />
-
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
-
Thank you so much works a treat.
-
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.
-
nvm worked it out you pointed me in the right directions thanks
-
But then that places my shopping cart in my banner area of the page..
-
what if im including this like <html> <body> <?php include('session.php'); </body> </html>
-
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.
-
thank you so much. so stupid of me thought i closed the table off. thanks.
-
no its just code which process a form. i just want the style sheet from my html code to take place is that possible?
-
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.
-
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.