253 users online (0 members and 253 guests)  


  Results 1 to 7 of 7

Related

  1. Not working in IE    Forum: HTML Forum
    Replies: 2
  2. PHP form- not working    Forum: PHP Forum
    Replies: 12
  3. Z-Index not working with IE.    Forum: Myspace Forum
    Replies: 1
  4. Why isn't this working?    Forum: HTML Forum
    Replies: 5
  5. It's 3:00 AM here and I'm working the .....    Forum: General Discussion
    Replies: 47
  1. #1
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel

    Next link not working

    I am working on the hosting directory and am having a problem with the pagination. Everything is working except that the next link does not appear. http://www.ahfb2000.com/hostindex.php
    PHP Code:
     print "<p align='center'>";
        if(
    $page != 1){  
            
    $pageprev $page 1
             
            echo(
    "<a href=\"$PHP_SELF?$qstring&page=$pageprev\">PREV</a>&nbsp;");  
        }else 
            echo(
    "PREV&nbsp;"); 

        
    $numofpages $numrows $limit;  
         
        for(
    $i 1$i <= $numofpages$i++){ 
            if(
    $i == $page
                echo(
    $i."&nbsp;"); 
            else 
                echo(
    "<a href=\"$PHP_SELF?$qstring&page=$i\">$i</a>&nbsp;");  
                }


        if((
    $numrows $limit) != 0){ 
            if(
    $i == $page
                echo(
    $i."&nbsp;"); 
            else 
                echo(
    "<a href=\"$PHP_SELF?$qstring&page=$i\">$i</a>&nbsp;"); 

        if((
    $numrows - ($limit $page)) > 0){ 
            
    $pagenext $page 1
              
            echo(
    "<a href=\"$PHP_SELF?$qstring&page=$pagenext\">NEXT</a>");  
        }else 
            echo(
    "&nbsp; NEXT ");  
         
        
    mysql_free_result($result); 
    }
    }
    print 
    "</p>"
    I am sure it is something here
    PHP Code:
    if(($numrows - ($limit $page)) > 0){ 
            
    $pagenext $page 1
    but cannot pinpoint it.

    Btw, take a look at the page layout. I just got done incorporating the welcome panel and am currently working on making every page compliant to XHTML 1.0 transitional. A major spring cleaning with a white glove, see ya next year

    Dave
    Last edited by HTML; 03-23-2009 at 04:07 PM.

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    I dont know if this is the problem, but try changing -
    PHP Code:
    echo("<a href=\"$PHP_SELF?$qstring&page=$pagenext\">NEXT</a>");   
        }else  
            echo(
    "&nbsp; NEXT "); 
    to

    PHP Code:
    echo("<a href=\"$PHP_SELF?$qstring&page=$pagenext\">NEXT</a>");   
        } else { 
            echo(
    "&nbsp; NEXT "); 
    We should be getting _something_ from that statement, so I wonder if its broken.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    Nope, that breaks it so I put in another closing bracket and I still get nothing.

    Dave

  4. #4
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    The only thing I can think of it going thru all the 'if' statements, and making sure they are all closed properly, ie

    PHP Code:
    if (action)
    {
    do 
    this
    } else {
    do 
    that

    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  5. #5
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    got it

    Dave

  6. #6
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    Here is the corrected code
    PHP Code:
    print "<p align='center'>"
        if(
    $page != 1){   
            
    $pageprev $page 1;  
              
            echo(
    "<a href=\"$PHP_SELF?$qstring&page=$pageprev\">PREV</a>&nbsp;");   
        }else { 
            echo(
    "PREV&nbsp;");  
        }

        
    $numofpages $numrows $limit;   
          
        for(
    $i 1$i <= $numofpages$i++){  
            if(
    $i == $page) {
                echo(
    $i."&nbsp;");  
            }else{
                echo(
    "<a href=\"$PHP_SELF?$qstring&page=$i\">$i</a>&nbsp;");   
                } 


        if((
    $numrows $limit) != 0){  
            if(
    $i == $page)  
                echo(
    $i."&nbsp;");  
            else  
                echo(
    "<a href=\"$PHP_SELF?$qstring&page=$i\">$i</a>&nbsp;");  
                  }
                  }
        if((
    $numrows - ($limit $page)) > 0){  
            
    $pagenext $page 1;  
               
            echo(
    "<a href=\"$PHP_SELF?$qstring&page=$pagenext\">NEXT</a>");   
        }else{
            echo(
    "&nbsp; NEXT ");   
          
        
    mysql_free_result($result);  


    print 
    "</p>"

  7. #7
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    I ran into another problem, whenever 5 or more pages were needed the page numbers doubled up



    grrrrrrr fix removed lol
    Last edited by HTML; 10-11-2003 at 02:07 PM.



Tags for this Thread