cello Posted July 28, 2007 Share Posted July 28, 2007 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. Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted July 28, 2007 Share Posted July 28, 2007 You could start with showing us some code so we can see why it doesn't work Quote Link to comment Share on other sites More sharing options...
cello Posted July 28, 2007 Author Share Posted July 28, 2007 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); ?> Quote Link to comment Share on other sites More sharing options...
cello Posted July 28, 2007 Author Share Posted July 28, 2007 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); ?> Quote Link to comment Share on other sites More sharing options...
cello Posted July 29, 2007 Author Share Posted July 29, 2007 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. Quote Link to comment 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.