View Full Version : page not showing up

05-21-2004, 04:16 PM
I swear, php is sooo unpredictable! It really drives me up the wall sometimes. I have a banner rotation on my site, and it should display a different site everytime the page loads, however sometimes it returns a blank page, no text at all, even in source and when a site does come up, it is always the same one
here is the code:

if ($_GET['action'] == 'banner') {
$ranUser = getRandomSiteForUser();
list($id, $name, $webName, $bannerUrl, $averRate, $numRated) = $ranUser;
if ($averRate == '')
$averRate = 0;
if ($numRated == '')
$numRated = 0;
if ($numRated < 2)
$voted = "$numRated vote";
$voted = "$numRated votes";
$averRate = round($averRate, 2);
for ($x = 10; $x >=1; $x--) {
$option .= "<option value=\"$x\">$x</option>";
echo "document.write('<table cellpadding=\"3\" cellspacing=\"0\"><tr><td valign=\"center\"><a href=\"http://luved.org/usersite.php?id=$id\" target=\"_blank\"><img src=\"$bannerUrl\" alt=\"$webName\" width=\"65\" height=\"49\" border=\"0\" /></a></td><td valign=\"center\"><form method=\"post\" action=\"http://luved.org/rateusersite.php?action=rate\"><b>Site:</b> <a href=\"http://luved.org/usersite.php?id=$id\" target=\"_blank\">$webName</a><br /><b>Owner:</b> $name<br /><b>Av. Rating:</b> $averRate ($voted)<br /><input type=\"hidden\" name=\"userid\" value=\"$id\" /><select name=\"rate\">$option</select><input type=\"submit\" name=\"ratesite\" value=\"Rate This Site\" /></form></td></tr></table>')";

this function getRandomSiteForUser(); returns the row of the random user info.

05-21-2004, 08:43 PM
Okay, well action has to be banner or none of that code will run. Are you sure that action is always banner?

Also, maybe getRandomSiteForUser() is where the problem is? Do an echo just before the call to getRandomSiteForUser() and see if that echo always shows up or not. It could be that getRandomSiteForUser() kicks out or does something weird..

Try those and if you're still totally baffled, post the code for getRandomSiteForUser() and we'll try and give you a hand.


05-22-2004, 02:57 AM
ok, here is where the code is:
refresh it a few times or until u see the blank page come up

when u go there u will see what i mean,
I DID put an echo right before getRandomSiteForUser() but that didn't show up either, nothing shows up when that blank page comes up, the echo only comes up when that one rotation comes up as well.

05-22-2004, 04:29 AM
interesting, after much investigation, i found that one of the banner images doesn't show up in a <img> tag
how bloody weird.
before I used a getimagesize() function to test whether an image link works, this image worked, but it doesn't work in a <img> tag
how would I test something like this so it doesn't happen again?

sorry, i should have edited the post above, I forgot sorry.