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
https://forums.phpfreaks.com/topic/62188-help-please/
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
https://forums.phpfreaks.com/topic/62188-help-please/#findComment-309539
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
https://forums.phpfreaks.com/topic/62188-help-please/#findComment-309554
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
https://forums.phpfreaks.com/topic/62188-help-please/#findComment-310402
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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