Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'image'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 6 results

  1. For some reason the images I am uploading to my uploads folder are just showing as blank, the files are there but it is not showing them as images. It is written that the type of file it is is just File. and it shows the path to the image D:\xampp\htdocs\uploads. My add_print.php is just fine as far as I can tell. I tested it with the script written by Larry in the working files for this book, it doesn't work either. I checked my permissions for my uploads folder and they look fine too. I am thinking the problem is maybe because no Mime type is specified for the images being uploaded. If that isn't where the error is, it is maybe in the code below, where my uploads folder is. it is specified as ../../../uploads. any help would be appreciated. if (is_uploaded_file($_FILES['image']['tmp_name'])){ $temp = '../../../uploads/' . md5($_FILES['image']['name']); if (move_uploaded_file($_FILES['image']['tmp_name'], $temp)){ echo '<p>The file has been uploaded!</p>'; $i = $_FILES['image']['name']; or could the problem be below:? if (mysqli_stmt_affected_rows($stmt) == 1){ echo '<p>The print has been added.</p>'; $id = mysqli_stmt_insert_id($stmt); rename ($temp, "../../../uploads/$id"); $_POST = array();
  2. Hi Larry. I have a problem with this script. The table show me files list correctly with name and size. When I click on link popup appear perfectly resized but no image was loaded. Popup show a copy of show_image.php resized. No errors on firebug. If I change: var url = "show_image.php?image="+image; with var url = "upload/"+image; everythings works fine. any suggestions? Sorry for my english. Greetings Cecchi Luca
  3. I want to display images on my page from a folder called forumimages. Right now it is just showing broken images. I have tried changing the directory and it doesn't work. My images are in the folder and they are jpegs. Here is the code. $directory = "../../forumimages/"; //get all image files with a .jpg extension. $images = glob($directory . "*.jpg"); //print each file name foreach($images as $image) { echo '<img src="' . $directory . '/' . $image . '" />'; }
  4. My show_image.php script is not working. When I click on the links the popup window comes up but the images don't display, only the unavailable.jpg image displays. I checked the uploads folder and it seems ok. I am using the downloaded script from this site to make sure the code is ok. For images.php, and upload_image.php, and functions.js, I am also using this site's scripts. I tried to see the source code from the popup window and there is nothing it is blank. Here is the show_images.php code. <?php # Script 11.5 - show_image.php // This page displays an image. $name = FALSE; // Flag variable: // Check for an image name in the URL: if (isset($_GET['image'])) { // Make sure it has an image's extension: $ext = strtolower ( substr ($_GET['image'], -4)); if (($ext == '.jpg') OR ($ext == 'jpeg') OR ($ext == '.png')) { // Full image path: $image = "../../../../uploads/{$_GET['image']}"; // Check that the image exists and is a file: if (file_exists ($image) && (is_file($image))) { // Set the name as this image: $name = $_GET['image']; } // End of file_exists() IF. } // End of $ext IF. } // End of isset($_GET['image']) IF. // If there was a problem, use the default image: if (!$name) { $image = 'images/unavailable.png'; $name = 'unavailable.png'; } // Get the image information: $info = getimagesize($image); $fs = filesize($image); // Send the content information: header ("Content-Type: {$info['mime']}\n"); header ("Content-Disposition: inline; filename=\"$name\"\n"); header ("Content-Length: $fs\n"); // Send the file: readfile ($image);
  5. I am having trouble creating the code to improve the security of add_print.php in Chapter 19. I am adapting the code from chapter 11 to this problem and not having any luck. I want to validate the file type before adding a print to the database. Does anyone have the solution to this review and pursue question? thanks
  6. Trying to test the upload script ("add_other_products.php") and, after submitting, get blank screen other than header. When I "refresh" page and resend data, I see a reference to "undefined index: image" which refers to these two lines: // check for image if (is_uploaded_file($_FILES['image']['tmp_name']) && .... this is line 49 in sample download script switch ($_FILES['image']['error']) { this is line 104 in sample download script While trying to figure this out, I deleted all references in the file to the image and I successfully added the test record to the database. But when I added back the references for the image, the same problem came back. I'm probably an intermediate user of php/MySQL and can often figure these things out. This one doesn't make sense. Any suggestions would be appreciate.
×
×
  • Create New...