SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Aug 2004
    Location
    Taunton, UK
    Posts
    787
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with dynamic image after PHP upgrade

    [RESOLVED] Please ignore as the error was in a different part of the script



    I upgraded my PHP from 4 to 5.2.8 and quite a lot of stuff has stopped working - ****!

    One such thing is the following line of code

    Code:
    echo "<img src=\"/".$starImagePath."\" title='Star Rating' alt='Star Rating' >";
    I have commented out this line of code to see what value $starImagePath has and it is

    starImagePath = ../images/3star.gif

    Here is the code block that the troublesome line of code is contained in

    Code:
    if ($starRating > 0) {
    
    	$starImage = $starRating . "star.gif";
    
    	$starImagePath = IMAGES_DIRECTORY.$starImage;
    
    	echo "starImagePath = " . $starImagePath;
    
    	echo "<img src=\"/".$starImagePath."\" title='Star Rating' alt='Star Rating' >";
    
    }
    When the line of code is included, my page displays absolutely nothing - just a blank window and the generated source is

    <html><head></head><body></body></html>

    Any ideas?

    Thanks

    Paul
    Last edited by chuckylefrek; Mar 3, 2009 at 09:04.
    Mediakitchen Limited
    App Development | Website Design & Development | Flash Game Development
    Somerset, UK
    http://www.mediakitchen.co.uk

  2. #2
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    You most likely have error display off, thus you don't get errors, just the blank page. Try to add this to the top of the script:

    PHP Code:
    ini_set('display_errors'1);
    error_reporting(E_ALL); 


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •