Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Apr 2004
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    page not showing up

    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:
    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";
    else
    	$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.

  • #2
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

    Sadiq.

  • #3
    New Coder
    Join Date
    Apr 2004
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok, here is where the code is:
    http://luved.org/rateusersite.php?action=banner
    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.
    Last edited by o0katz0o; 05-22-2004 at 03:10 AM.

  • #4
    New Coder
    Join Date
    Apr 2004
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •