SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Apr 2003
    Location
    Washington, DC
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    problem with $_GET?

    Okay this seems so simple but it refuses to work... Any help would be greatly appreciated. It will only get to the first statement and refuses to go past that. Obviously it is getting the variable but I don't know why it won't go to the next statement after $_GET['display'] equals 10. It is weird because it worked when I coded the forum and tested everything... You can see it working at the link below. It won't work on the site the forum is being included on though. Both sites are on the same server.

    test version:
    http://zealivityfive.com/forum.php

    Code:
    //query all threads
    $q = mysql_query("SELECT * FROM forum_threads") or die("error! ".mysql_error());
    $r = mysql_num_rows($q);
    
    //default only active on the main page
    if (($_GET['display'] == "")) {
       $next = "10";
       $previous = "0";
       }
       
       elseif (($_GET['display'] == 10)) {
           $next = "20";
           $previous = "10";
           }
    
           //action to display while browsing older threads
           elseif (($_GET['display'] > 10)) {
               $next = ($_GET['display']+10);
               $previous = ($_GET['display']-10);
               }
    
               //active if the thread count exceeds total threads stored
               //and will revert to the number of thread rows in the database
               elseif (($_GET['display'] > $r)) {
                   $next = "$r";
                   $previous = ($r-10);
                   }
    
    //browse threads
        if (($_GET['view'] !== "thread")) {
            echo "<h3><a href=\"?support?display=$next\">next page</a></h3>";
            }
    anyone seen my website link?

  2. #2
    SitePoint Enthusiast Bare Koncept's Avatar
    Join Date
    May 2006
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try putting a space making "elseif" ==> "else if"

  3. #3
    SitePoint Zealot
    Join Date
    Apr 2003
    Location
    Washington, DC
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nah that wasn't the problem. it had to do with the url for some reason. anyway got it all working.
    anyone seen my website link?


Bookmarks

Posting Permissions

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