Jump to content
Larry Ullman's Book Forums

Ryan R

Members
  • Content Count

    63
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Ryan R

  • Rank
    Advanced Member
  1. Thanks, Larry. It works perfectly after changing my header to what you suggested. I guess I should change host url to www.paypal.com later when I use it for live site. Or should I use www.paypal.ca as I am in Canada?
  2. I know that "if(strcmp($res, "VERIFIED") < 0){" means it's not verifying at all. I've appended the value of $res to my database right before "if(strcmp($res, "VERIFIED") < 0){". The value is below: Invalid Host header Content-Length: 19 Connection: close Server: BigIP HTTP/1.0 400 Bad Request I've got this message 2 times.
  3. I set up my sandbox account and built my ipn based on book. I am having trouble passing through "VERIFIED" section. If code is like this below: if(strcmp($res, "VERIFIED") == 0){ it's not going through. But if I put less than 0 like below: if(strcmp($res, "VERIFIED") < 0){ it works perfectly. I assume that the string in $res is shorter or lower characters than the string "VERIFIED". Since I don't know the exact string that I get from $res, I don't seem to find any solution about verification process. I am putting my code below in case you can
  4. Thanks guys! It helps me to understand it better. I have one more thing I want to sort out. If I want to apply to another example like this: $live = false; <?php if(!$live){ define('....', '.....'); }else{ define('..--','...--'); } !$live means "not live". Therefore $live is "live". Interestingly even though its value is false, it represents that "it's live". Is it because the value doesn't exist so that it can be on line without being affected to this flag ? Thanks.
  5. Hi, I find that "(!flag)" has been confusing throughout the time that I am reading the book. If you look at the example below: $header = false; // Loop through the results: while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) { // If the header hasn't been shown, create it: if (!$header) { ......?> I think that "!$header" means TRUE since it's started with "false" default value. But you described that "!$header" means FALSE.. I think I need a little bit of more explanation to understand clearly. thanks.
  6. Hi, I have a question for uploading image part in add_print.php. Usually you would get rid of temporary file on the server after moving the file to the permanent location ( ex) ../uploads/$_FILES['image']['name'] ). However, in "add_print.php" file, it shows you delete the original file (the code like this below:) // Delete the uploaded file if it still exists: if ( isset($temp) && file_exists ($temp) && is_file($temp) ) { unlink ($temp); } If you go up to the beginning part of this code, you will see : // Check for an image: if (is_uploaded_file ($_FI
  7. Thanks HartleySan, It is good to know. Maybe I should do that according to what you recommended me. Larry - I am sorry. I won't use that last word again. I created the stored procedure and executed it. But it didn't work. Like HartlySan mentioned above, I am having the exact same issue as his. I guess I will need to switch them to prepared statements.
  8. Thank you very much for your reply, Larry I tried "select_categories" stored procedure by typing $$ on the delimiter blank box. But it still doesn't work. The error message is: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER' at line 1 Interestingly, When I check "select_categories" stored procedure on the phpmyadmin, it shows me that it exists. So I made a test web page in which I put a query that called this stored procedure. When I put it on my server, it didn't work...
  9. Thank you very much, Larry. Yes, I am using phpMyAdmin. I am sorry but I will need to ask you where the check box is... Only thing I can find is that there's a box for delimiter and in that box, semicolon is typed in as a default. Should I change this to $$?
  10. Hi all, I am sure some of you already checked my two previous post about inventory and the error issue on billing.php. You can just ignore it. I figured it out. Thanks for your efforts and attentions to my past posts. Today, I have a just simple question about stored procedures. I recently bought a hosting service from Godaddy.com and the version of PHP is 5.2 and MySQL is 5.0. I try to run this stored procedure: DELIMITER $$ CREATE PROCEDURE select_categories (type VARCHAR(6)) BEGIN IF type = 'coffee' THEN SELECT * FROM general_coffees ORDER by category; ELSEIF
  11. Hi all, Thanks for your help and attention to this. I just want to talk about the questions that I posted on this forums last week. There were two issues I couldn't figure out. One of two issues was solved: Issue 1: The inventory stock figure isn't changing after clicking "ship this order" button - solved I tried again for the inventory stock part according to the book " effortless ecommerce". It works well now. But the other issue is still there. Issue 2: After you order some items on the customer side ( *web pages that are not in admin folder) and go to admin page and
  12. Please see billing.php file below. The problem line is in bold ---------------------------------------------------------------------- <?php // This file is the second step in the checkout process. // It takes and validates the billing information. // This script is begun in Chapter 10. // Require the configuration before any PHP code: require ('./includes/config.inc.php'); // Start the session: session_start(); // The session ID is the user's cart ID: $uid = session_id(); // Check that this is valid: if (!isset($_SESSION['customer_id'])) { // Redirect the u
  13. Hi all, After I finished up the view_order.php updates, I tested website. I ordered random items and processed it. I went to admin page and accepted the button to ship the items. After that, you will usually expect that your inventory stock will be reduced as you put this code in view_order.php: (please see below) --------------------------------------------------------------------------------------------------------------------------- // Update the inventory... $q = 'UPDATE specific_coffees AS sc, order_contents AS oc SET sc.stock=sc.stock-oc.quantity WHERE sc.id=oc.prod
×
×
  • Create New...