Jump to content
Larry Ullman's Book Forums


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About reborn4tomorrow2509

  • Rank
  1. UPDATE #2: Really trying to understand whats going on here, as I'm struggling to get the image to display for the view_print.php page. I even tried moving the ch19_uploads folder one level even deeper ( outside of the www directory itself and straight int the wamp64 directory, like I did with the folder 'uploads' in chapter 11 ) and though I can add images to this folder via add_print.php, I can't for some reason get view_print.php to display anything! The problem it seems to me, is that in the show_image.php script, where it checks that the image exists and is a file, $image is FAL
  2. UPDATE: the reason that default image was appearing instead of the prints was because the original script in the book did not hard code any file extension for the file path and image. The default 'oops' image appears if an image does not have a .jpg file extension set. I tried to set them manually by modifying the line that renames the function like so: rename($temp, "../../ch19_uploads/$id".".jpg"); Now what im seeing is no default image appears, just the message 'no image available' is being displayed on the screen for each print. I think i'll take a break, have a coffee an
  3. I did try and look at the html source code using 'view source' and noticed that the ampersand '&' in the url itself was highlighted in red, not sure if thats normal or not. when viewing source code, the line which shows the url image source reads: <img src="show_image.php?image=1&name=daydreaming_by_the_river_image_copy_low_res.jpg" width="900" height="747" alt="Day dreaming by the River" /> Going into the folder where I manually saved the images from the website art2arts, ( its just a folder containing the images i select for uploading into ch19_uploa
  4. Hi Larry, yes the complete path would be: C:\wamp64\www\ch19_uploads all uploaded images of prints end up in that folder. As for the complete path from where my scripts are being run, that would be: C:\wamp64\www\ch19, from here the scripts are being run. so to 'get at' the images, in the scripts the path is usually defined as '..\ch19_uploads' and obviously if i'm in a level 2 folder within ch19, i.e admin, then the path to get at ch19_uploads or the mysqli_connect_ch19.php script would be ..\..\ch19_uploads.
  5. Sorry folks, I had to reply to my own post because I wanted to also share my 'show_image.php' script code with you all: <?php # Script 19.8 - show_image.php // This page retrieves and shows an image. // Flag variables: $image = FALSE; $name = (!empty($_GET['name'])) ? $_GET['name'] : 'print image'; // Check for an image value in the URL: if (isset($_GET['image']) && filter_var($_GET['image'], FILTER_VALIDATE_INT, array('min-range' => 1 )) ) { $image = '../ch19_uploads' . $_GET['image']; // Check that the image exists as a file on the server if (!file_exists($image) || (!
  6. Hi all, I'm running the php files on my machine using the wampserver environment with mysql all scripts/pages are located in the 'www' folder, i.e root directory. Inside the www directory I created a folder 'ch19' and its in this folder where all my files and folders for this chapter reside. so to run the ecommerce example site, the url is localhost/ch19/ ch19 directory contains the following php scripts: index.php, browse_prints.php, show_image.php and view_print.php ( I have not gone as far as the view_cart.php and add_cart.php just yet, will do once I've got this t
  • Create New...