Results 1 to 4 of 4

Thread: php returning blank screen & I cant find error

  1. #1
    Join Date
    Jul 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default php returning blank screen & I cant find error

    I really believe I have gone through all the steps, but my php is returning no errors, or any out put at all. I'm trying to do the following exercise:

    http://www.dynamicdrive.com/dynamici...photoalbum.htm

    what I noticed was that it wasn't working, so I decided to go directly to my .php file and got absolutely no output at all. Pretty frustrating

    (see for yourself)
    http://www.oldpcgaming.com/test/pics/getalbumpics.php

    I try the same script located on dynamic's sample and I get expected results
    http://www.dynamicdrive.com/dynamici...talbumpics.php

    so I configured php.ini on my server to show error logs, and I see nothing, now what? the error log isn't populating with anything, and I even tried a error_reporting(E_ALL) command but I barely understand how to use it.

    I made a info.php in the same directory to test to see if php was working at all (and it appears that it is)

    http://www.oldpcgaming.com/test/pics/info.php

    I am at a complete loss, any help from the php experts?

    Code:
    <?php 
     error_reporting(E_ALL); 
    ?>
    
    <?
    Header("content-type: application/x-javascript");
    
    function returnimages($dirname=".") {
       $pattern="\.(jpg|jpeg|png|gif|bmp)$";
       $files = array();
       $curimage=0;
       if($handle = opendir($dirname)) {
           while(false !== ($file = readdir($handle))){
                   if(eregi($pattern, $file)){
    		 $filedate=date ("M d, Y H:i:s", filemtime($file));
                     echo "		[$curimage, \"$file\", \"$filedate\"],\n";
                     $curimage++;
                   }
           }
           echo "		[\"placeholder\"]\n";
           closedir($handle);
       }
       return($files);
    }
    
    $photovar=$_GET['id'];
    if (!eregi("^[a-zA-Z0-9_]+$", $photovar)){
    	echo "alert(\"Photo Album ID must contain only letters, numbers, or underscore, and cannot start with a number\")";
    	die();
    }
    echo "var $photovar={\n";
    echo "	baseurl: \"http://" . $_SERVER["SERVER_NAME"] . dirname($_SERVER['PHP_SELF']) . "/\",\n";
    echo "	images: [\n";
    returnimages();
    echo "	],\n";
    echo "	desc: []\n";
    echo "}\n";
    ?>
    Last edited by jabbyjim; 07-19-2011 at 06:24 PM. Reason: hated title

  2. #2
    Join Date
    Jul 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    omg I'm stupid...

    <?php


    sorry gents!

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    For future reference, PHP only returns errors if it understands enough of the code to respond to it. When there is a parse error for the page as a whole such as a missing parenthesis or missing <?php or ?>, you may receive no response at all because PHP does not even know where to begin. If this happens, debug for major typos like that, and usually it will fix it.
    (Or, for others facing a similar problem, you might need to turn on error reporting.)
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #4
    Join Date
    Jul 2011
    Location
    Lockport, Illinois
    Posts
    35
    Thanks
    4
    Thanked 2 Times in 2 Posts

    Default

    quick note, to avoid future confusion, note that show error logs and show errors in php.ini are 2 totally different things, make sure you enable the correct one, because it annoying when you cant figure out why no errors are displaying only to realize you enabled the wrong thing. lol... can you tell ive been down that road? :P

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
  •