Jump to content

HELP please


cello

Recommended Posts

I appologise in advance but i am desparate...

 

My php web guy sory X php web guy as been uncontactable for months and hence i am resorting to trying to learn what has gone wrong with my web site.

 

It uses php/mysql to host images and lost the objects/pix sometime ago. the images appear to be in the images path but i get an error - php premature end of script headers on the galleries page that serves out the different categories. I have not changed anything and doubtl my x php web guy has.

 

Any help . tips would be appreciated . I understand the theory of PHP/web pages but not the progam language so it all looks a bit above me. Aagain any pointers would be appreciated.

Link to comment
Share on other sites

OK sorry, I believe the <?PHP is the start of code and ?> end of code?

 

Heres the code..........

 

<?php

include('lib/global.php');

 

# First we check the selected category exists - if not we're at the category home (catid -1).

$catid=getReqInt('catid','-1');

if ($catid != -1) {

$count=$sqlProc->queryCount("SELECT count(*) AS count FROM pix_cat WHERE catid = $catid",'count');

if ($count<1) $catid = -1; }

 

$catPath = array();

# If we're not at the category home, we recurse the categories backwards

if ($catid != -1) {

$curParent = $catid;

while($curParent != -1) {

$cat = $sqlProc->queryRow("SELECT catid,parentid,name,public FROM pix_cat WHERE catid = $curParent");

$curParent = $cat['parentid'];

array_push($catPath,$cat);

}

}

array_push($catPath,array('catid'=>-1,'name'=>'Home','public'=>'true'));

$catPath = array_reverse($catPath);

# debug($catPath);

 

# Now we find all subcategories of this category

$subCats=$sqlProc->queryArray("SELECT * FROM pix_cat WHERE parentid = $catid ORDER BY name ASC",MYSQL_ASSOC,'catid');

$subids=array_keys($subCats);

foreach($subids as $subid){

$subCats[$subid]['subcount']=

$sqlProc->queryCount("SELECT count(*) AS count FROM pix_cat WHERE parentid = $subid",'count');

$subCats[$subid]['piccount']=

$sqlProc->queryCount("SELECT count(*) AS count FROM pix_index WHERE catid = $subid",'count');

}

 

$rowsPerPage = 3;

$picsPerRow = 3;

$picsPerPage = $rowsPerPage * $picsPerRow;

 

$p=getReqInt('p',1);

 

# Now we find all the pictures in this category

$numPics = $sqlProc->queryCount("SELECT count(*) AS count FROM pix_index WHERE catid = $catid",'count');

$numPages=ceil($numPics/$picsPerPage);

if ($p>$numPages) $p=$numPages;

$picstartvalue = intval(($p-1)*$picsPerPage);

if ($picstartvalue<0) $picstartvalue=0;

 

$pics=$sqlProc->queryArray("SELECT * FROM pix_index WHERE catid = $catid ORDER BY timestamp DESC

LIMIT $picstartvalue,$picsPerPage");

 

$picsThisPage=count($pics);

?>

Link to comment
Share on other sites

sorry slow learner!

 

<?php
include('lib/global.php');

# First we check the selected category exists - if not we're at the category home (catid -1).
$catid=getReqInt('catid','-1');
if ($catid != -1) {
   $count=$sqlProc->queryCount("SELECT count(*) AS count FROM pix_cat WHERE catid = $catid",'count');
   if ($count<1) $catid = -1; }

$catPath = array();
# If we're not at the category home, we recurse the categories backwards
if ($catid != -1) {
   $curParent = $catid;
   while($curParent != -1) {
      $cat = $sqlProc->queryRow("SELECT catid,parentid,name,public FROM pix_cat WHERE catid = $curParent");
      $curParent = $cat['parentid'];
      array_push($catPath,$cat);
   }
}
array_push($catPath,array('catid'=>-1,'name'=>'Home','public'=>'true'));
$catPath = array_reverse($catPath);
# debug($catPath);

# Now we find all subcategories of this category
$subCats=$sqlProc->queryArray("SELECT * FROM pix_cat WHERE parentid = $catid ORDER BY name ASC",MYSQL_ASSOC,'catid');
$subids=array_keys($subCats);
foreach($subids as $subid){
   $subCats[$subid]['subcount']=
      $sqlProc->queryCount("SELECT count(*) AS count FROM pix_cat WHERE parentid = $subid",'count');
   $subCats[$subid]['piccount']=
      $sqlProc->queryCount("SELECT count(*) AS count FROM pix_index WHERE catid = $subid",'count');
}

$rowsPerPage = 3;
$picsPerRow = 3;
$picsPerPage = $rowsPerPage * $picsPerRow;

$p=getReqInt('p',1);

# Now we find all the pictures in this category
$numPics = $sqlProc->queryCount("SELECT count(*) AS count FROM pix_index WHERE catid = $catid",'count');
$numPages=ceil($numPics/$picsPerPage);
if ($p>$numPages) $p=$numPages;
$picstartvalue = intval(($p-1)*$picsPerPage);
if ($picstartvalue<0) $picstartvalue=0;

$pics=$sqlProc->queryArray("SELECT * FROM pix_index WHERE catid = $catid ORDER BY timestamp DESC
   LIMIT $picstartvalue,$picsPerPage");

$picsThisPage=count($pics);
?>

Link to comment
Share on other sites

Sorry to bump but I am still CONFUSED.

 

Can anyone shed a light as to what may have gone wrong. Images appear to get uploaded ok but when you click on a web page which is genreated by the php code all you get is a unlinked object (x). This problem affects all images on my site even new images I post.

 

The system uses mysql db and a php front end. Would appreciate some tips on what aobvious things to look for ....

 

images are in the gallery folder - OK

not sure how to check the db aother then the webinfo page shows the db is running.

Link to comment
Share on other sites

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.