Jump to content

Dakkadakka

Members
  • Content Count

    33
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Dakkadakka

  • Rank
    Newbie
  1. This, and the tutorial, worked like a charm. Thanks. I didn't know i could do that. I was hesitant to try it and it worked on,like, the third try. This was the key foreach($_POST['item_id'] as $key=>$item_id){ $qty = $_POST['qty'][$key];$product_id = $_POST['product_id'][$key];$customer_id = $_POST['customer_id'][$key]; //Carry out the individual item query like usual.}
  2. I wrote update cart.php. It's a very simple script that checks the quantity of the row item and it updates the respective row on the database. I've been improving my PHP all summer at my paid internship but am stuck on this problem. //Data has been retrieved at this point. // database connectionmysql_connect("localhost", $dbuser, $dbpass) or die(mysql_error());mysql_select_db($dbname) or die("Unable to select database"); $query = "SELECT * FROM cart_line WHERE cart_id = '".$cart_id."' AND product_id = '".$product_id."'";//echo $query."<br>";$search = mysql_query($query) or die(mysql_e
  3. I don't know how to make the form do that. If there are a variable number of items in the cart, how do I make one form for all of them, and how do I make the PHP check them all? I can't seem to find examples anywhere. I know carts have done it before.
  4. I made a fully working shopping cart, but the problem is that in my line of business, customers may order a hundered items, and having to adjust quantities line by line could be a big hassle. My cart includes suggestions based on customer history due to the tremendous amount of things people typically buy. while($row=mysql_fetch_array($result)){//We grab the product id as well as everything else we need.$product_id= $row['product_id'];$sales_info = $row['sales_info'];$sku= $row['sku'];$qty= $row['qty'];$final_price = $row['final_price']; $price = $row['price'];$purchase_cost = $row['purchase_
  5. I'm trying to get a string representative of an XML sheet send to a web service. This is how sales orders will be submitted online. The web service stores the order in a database. The web service is meant to take in a string to be read as XML. PHP and SOAP can't send XML to a web service as is and I'm having trouble working around this.First here is the code that generates the string.$xmlDocument = '<?xml version="1.0" encoding="utf-16"?>'; $xmlDocument.= '<SalesOrder dateCreated="'.$year.'-'.$mon.'-'.$day.' '.$hour.':'.$minutes.':'.$seconds.'" amount="'.$amount.'" mark_up="15.0000" c
  6. The error log pointed out a typo. I don't remember what it was but i took care of it and it doesn't show any new problems. According to phpinfo(), SOAP is definitely turned on. I'm at my wits end because I've never worked with SOAP before.
  7. I am trying to make a shopping cart and am using a web service my partner made to complete a transaction. The idea is to build an xml sheet and then transmit it to the web service using SOAP, but since PHP is a web language I am having problems. The web service is expecting a string, but the web service keeps getting a null pointer each time I try to submit the XML. $xmlDocument = '<?xml version="1.0" encoding="utf-16"?>'; $xmlDocument.= '<SalesOrder dateCreated="'.$year.'-'.$mon.'-'.$day.' '.$hour.':'.$minutes.':'.$seconds.'" amount="'.$amount.'" mark_up="15.0000" customerID="'
  8. That's a fantastic trick. I found the problem too. Thanks!
  9. I must be making some kind of silly mistake, but I have some php and sql intended to retrieve information on a customer for a shopping cart. In particular, their contact into and invoice history. For the life of me I cannot figure out why the invoice history is printing out empty blank rows. This is the code. There are two different queries going on. One for the contact info, and one of their invoices. Here is the code. <?php $dbuser = ""; $dbpass = ""; $host = "localhost"; $dbname = ""; // database connection mysql_connect("localhost", $dbuser, $dbpass) or die(mysql_error())
  10. ....removing including this solved my problems! Still, this makes me uncomfortable. What are the security limitations using the default? I would love thing more than the provided script to work, but I have to move forward.
  11. I'm learning to use this now. Thanks.
  12. session.php is a script from here:http://w3schools.invisionzone.com/index.php?showtopic=9731 I made the appropriate database for it, and I moved session start but that didn't have an effect. It looks like this. <?php session_start();include 'session.php'; var_dump($_SESSION);if (isset($_SESSION['customer_id'])){ //Grab their session data$customer_id = $_SESSION["customer_id"];$first_name = $_SESSION["first_name"];$last_name = $_SESSION["last_name"];$price_level = $_SESSION["price_level"];$sales_rep = $_SESSION["sales_rep"]; }else{echo 'Not a logged in person<br>';} ?>
  13. That is a neat trick. If I put the vardump before the header the code looks like this. This means I can't use the header, but I can see the session array successfully filled. session_start();$_SESSION['customer_id'] = $customer_id;$_SESSION['first_name'] = $first_name;$_SESSION['last_name'] = $last_name;$_SESSION['price_level'] = $price_level;$_SESSION['sales_rep'] = $sales_rep;var_dump($_SESSION); //header('Location: index-in.php'); ?> It successfully displays the customer session according to the customer number I enter. This is one for example. I'm not giving the name of coursearray
  14. It always displays the debug line "Not a logged in person." I start the session but I'm not seeing the session data being transferred.
  15. I just changed it and it still didn't do the trick. Sorry, this is my first time learning sessions. //Give the user a session HEREsession_start();$_SESSION['customer_id'] = $customer_id;$_SESSION['first_name'] = $first_name;$_SESSION['last_name'] = $last_name;$_SESSION['price_level'] = $price_level;$_SESSION['sales_rep'] = $sales_rep; //This debug line makes sure the session array has all areas filled//echo "Your name is ".$_SESSION['first_name']." ".$_SESSION['last_name']."<br>(and the peronalized Level is ".$_SESSION['price_level'].")";header('Location: index-in.php'); ?> And the
×
×
  • Create New...