wmguk Posted October 9, 2007 Share Posted October 9, 2007 hey guys, I use a script and it has been working, however, i now only get a blank page, and i dont know why? any thoughts? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <?php $login = $_GET['login']; $loginlower = strtolower($login); $ceremony = $_GET['ceremony']; $counters = $_GET['counters']; // Make Connection include '../scripts/connection.php'; if (!$con) { die('Could not connect: ' . mysql_error() ); } mysql_select_db($db, $con); //Run the update query $sql = "UPDATE album SET counters = '$counters' WHERE login = '$loginlower'"; mysql_query( $sql , $con ) or die( "<strong>Query Error</strong>: " . mysql_error() . "<br><strong>Query</strong>: $sql<br><br>" ); //Close the connection mysql_close($con); $NBFile=0; $dir ="../../clients/$loginlower"; if ($handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { //if (substr($file, strlen($file)-3, 3)=="jpg" ) { $FileArray[] = $dir."/".$file; $NBFile=$NBFile+1; //} } } } closedir($handle); ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } .image{ border-style:outset; border-color: black; border-width:1px; } </style> </head> <body><table align="center"><tr> <?php echo '$loginlower' ; echo '$dir' ; $NBPicswidth=1; $NBPics=0; for ($i=0; $i<$NBFile; $i++) { $Pic_Name1=$FileArray[$i]; ?> <td><a href="dis.php?image=<?php echo $Pic_Name1; ?>&ceremony=<? echo $ceremony; ?>&login=<? echo $login; ?>" target="order"><img src="<?php echo $Pic_Name1; ?>" width="100" hspace="0" vspace="0" border="1" /></a><br /> <hr width="60" /></td> <?php $NBPics=$NBPics+1; if ( $NBPics==$NBPicswidth ) { $NBPics=0; ?> </table> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/72539-my-script-just-displays-a-blank-page-any-help-please/ Share on other sites More sharing options...
MadTechie Posted October 9, 2007 Share Posted October 9, 2007 echo '$loginlower' ; echo '$dir' ; should be echo $loginlower; echo $dir; also is $_GET['login'] being set ? Quote Link to comment https://forums.phpfreaks.com/topic/72539-my-script-just-displays-a-blank-page-any-help-please/#findComment-365768 Share on other sites More sharing options...
sasa Posted October 9, 2007 Share Posted October 9, 2007 you don't close your last for and if bloks ad two } on the end change line if ( $NBPics==$NBPicswidth ) { $NBPics=0; ?> to if ( $NBPics==$NBPicswidth ) { $NBPics=0; }}?> Quote Link to comment https://forums.phpfreaks.com/topic/72539-my-script-just-displays-a-blank-page-any-help-please/#findComment-365776 Share on other sites More sharing options...
wmguk Posted October 9, 2007 Author Share Posted October 9, 2007 echo '$loginlower' ; echo '$dir' ; should be echo $loginlower; echo $dir; also is $_GET['login'] being set ? Ah yes, sorry those echos were just to make sure $_GET['login'] is being set, and yes it is, so thats working, the web address directly accessing the folder is www.webaddress.com/clients/loginname and the script you've seen runs at www.webaddress.com/admin/gallery/thumb.php you don't close your last for and if bloks ad two } on the end change line if ( $NBPics==$NBPicswidth ) { $NBPics=0; ?> to if ( $NBPics==$NBPicswidth ) { $NBPics=0; }}?> thank you just edited this, but still no change, no images are coming out in the thumbnails any other thoughts? Quote Link to comment https://forums.phpfreaks.com/topic/72539-my-script-just-displays-a-blank-page-any-help-please/#findComment-365780 Share on other sites More sharing options...
MadTechie Posted October 9, 2007 Share Posted October 9, 2007 No change (as in a blank page) or no images ? lets update some error checking if ($handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { //if (substr($file, strlen($file)-3, 3)=="jpg" ) { $FileArray[] = $dir."/".$file; $NBFile=$NBFile+1; //} } } }else{ //update echo "Invalid path";//Add }//add Quote Link to comment https://forums.phpfreaks.com/topic/72539-my-script-just-displays-a-blank-page-any-help-please/#findComment-365784 Share on other sites More sharing options...
wmguk Posted October 9, 2007 Author Share Posted October 9, 2007 No change (as in a blank page) or no images ? lets update some error checking if ($handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { //if (substr($file, strlen($file)-3, 3)=="jpg" ) { $FileArray[] = $dir."/".$file; $NBFile=$NBFile+1; //} } } }else{ //update echo "Invalid path";//Add }//add Oh sorry, its no images, the echo $dir etc works and shows up added the code above and no change, nothing is different. so i'm guessing the path is correct.. this script has been working, i dont understand this... Quote Link to comment https://forums.phpfreaks.com/topic/72539-my-script-just-displays-a-blank-page-any-help-please/#findComment-365795 Share on other sites More sharing options...
MadTechie Posted October 10, 2007 Share Posted October 10, 2007 change for ($i=0; $i<$NBFile; $i++) { $Pic_Name1=$FileArray[$i]; to print_r($FileArray); for ($i=0; $i<$NBFile; $i++) { $Pic_Name1=$FileArray[$i]; lets see what we get Quote Link to comment https://forums.phpfreaks.com/topic/72539-my-script-just-displays-a-blank-page-any-help-please/#findComment-365805 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.