Jump to content

my script just displays a blank page, any help please?


Recommended Posts

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>

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?

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

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...

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.