Jump to content
Larry Ullman's Book Forums

Jocky

Members
  • Posts

    4
  • Joined

  • Last visited

Jocky's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Thanks Paul. You are a life-saver. I changed the PDFS_DIR definition to how you described and it worked a treat. I have only been using PHP for a few months, so still learning a lot. Thanks again!
  2. Hi Larry, I have a problem trying to upload a pdf file. I get the following error message: An error occurred in script '/mnt/vol3/home/b/e/bexcom/public_html/e-Commerce/kip/add_pdf.php' on line 52: move_uploaded_file(www.bexcomputersdesigns.co.uk/e-Commerce/pdfs/bd42c707f6a002d4abd8993fa08236eb5ca84e6a_tmp) [function.move-uploaded-file]: failed to open stream: No such file or directory This is the section (including the line numbers for reference) from the add_pdf.php file: 46 // If no errors, create file's new name and destination 47 if (!array_key_exists ('pdf', $add_pdf_errors)) { 48 $tmp_name = sha1 ($file['name'] . uniqid ('', true)); 49 $dest = PDFS_DIR . $tmp_name . '_tmp'; 50 51 // Move the file 52 if (move_uploaded_file ($file['tmp_name'], $dest)) { 53 $_SESSION['pdf']['tmp_name'] = $tmp_name; 54 $_SESSION['pdf']['size'] = $size; 55 $_SESSION['pdf']['file_name'] = $file['name']; 56 echo '<h4> 57 The file has been uploaded! 58 </h4>'; 59 } else { 60 trigger_error ('The file could not be moved.'); 61 unlink ($file['tmp_name']); 62 } 63 } // End of array_key_exists() IF. This is how I have set up the paths in my config.inc.php file: define ('BASE_URI','www.bexcomputersdesigns.co.uk/e-Commerce/'); define ('BASE_URL','www.bexcomputersdesigns.co.uk/'); define ('MYSQL','includes/mysql.inc.php'); define ('PDFS_DIR',BASE_URI . 'pdfs/'); All my files are within a folder called kip which this is within a folder called e-Commerce. I have placed the pdfs folder within the e-Commerce folder so it was outside the root directory. Hope this information helps.
  3. Hi Larry. Thanks for the reply. I have now found what the problem was. In the ipn.php script, for some unknown reason, I had an open bracket before $_POST when it shouldn't have been there... $uid = (isset($_POST['custom'])) ? (int) ($_POST['custom'] : 0; Should have been... $uid = (isset($_POST['custom'])) ? (int) $_POST['custom'] : 0; For something so small, can cause big problems. And being just one character can make it difficult to spot. I have now got a problem with uploading pdf's, but I shall post this as a separate topic.
  4. Hi Larry, First of all great book! Have learned a lot about eCommerce. I have a problem getting the IPN to work correctly. Everything on the Knowledge Is Power site works as it should, but after I modify the Register and Thanks scripts and add the ipn.php script, the database does not get updated. I can register and the user details get added to the database. After the PayPal process, the payment is going through, but the database is not getting updated to expire a year later. Is there something I have missed or done wrong? I have been checking the instructions in the book, but can't see what is causing this issue. Thanks.
×
×
  • Create New...