SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Evangelist Worldbuilder's Avatar
    Join Date
    Jan 2004
    Location
    Boston, MA
    Posts
    481
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Just have to put quotes in an anchor, probably simple

    Hello,

    This page: http://www.bartlett-family.net/chris...eauty&search=1

    The anchors for the links of additional page results at the bottom need to be encased in quotation marks.

    The php code generating these links is
    PHP Code:
    print "<a href=\"".$_SERVER['PHP_SELF']."?query=".addmarks($query)."&amp;start=".$prev."&amp;search=1&amp;results=$results_per_page&amp;type=$searchtype\">".$sph_messages["Previous"]."</a> "
            
    $firstpage $start $links_to_next;
            if (
    $firstpage 1$firstpage 1;
            
    $lastpage $start $links_to_next;
            if (
    $lastpage $pages$lastpage $pages;

            for (
    $x=$firstpage$x<=$lastpage$x++)
                if (
    $x<>$start)    {
                    print 
    "<a href=".$_SERVER['PHP_SELF']."?query=".addmarks($query)."&start=$x&search=1&results=$results_per_page&type=$searchtype>$x</a> ";
                }
            else
                print 
    "<b>$x </b>";
            if (
    $next <= $pages)
                print 
    "<a href=\"".$_SERVER['PHP_SELF']."?query=".addmarks($query)."&amp;start=".$next."&amp;search=1&amp;results=$results_per_page&amp;type=$searchtype\">".$sph_messages["Next"]."</a>";
        } 
    Bottom line is that if you look at the source, on line 56, you see
    Code:
    <a href=/
    which needs to be
    Code:
    <a href="/
    I hope I'm explaining this right... LOL. I've played with it, but since I know nothing about php, I always end up getting parse errors or something else regarding quotes wheere they shouldn't be. Erf...

    Any help, please?

    Chris

  2. #2
    SitePoint Member
    Join Date
    Jul 2005
    Location
    Sweden
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This should do it.

    PHP Code:
    print "<a href=\"".$_SERVER['PHP_SELF']."?query=".addmarks($query)."&start=$x&search=1&results=$results_per_page&type=$searchtype\">$x</a>"

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    Bloomington, IL
    Posts
    93
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    print "<a href=".$_SERVER['PHP_SELF']."?query=".addmarks($query)."&start=$x&search=1&results=$results_per_page&type=$searchtype>$x</a>"
    Should be:
    PHP Code:
    print "<a href=\"".$_SERVER['PHP_SELF']."?query=".addmarks($query)."&start=$x&search=1&results=$results_per_page&type=$searchtype\">$x</a>"
    You forgot the \".

    Edit:

    Jahaa beat me to it.

  4. #4
    SitePoint Evangelist Worldbuilder's Avatar
    Join Date
    Jan 2004
    Location
    Boston, MA
    Posts
    481
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Erf... That isn't working. This is for HTML 4.01 validation, and by doing this in the middle print statemtn, I go from 6 errors to 59, AND only odd numbered results pages show, not all of them. What am I doing wrong?

    Chris

  5. #5
    SitePoint Evangelist Worldbuilder's Avatar
    Join Date
    Jan 2004
    Location
    Boston, MA
    Posts
    481
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    BTW... Not my code. I know almost nothing about php!

    Chris

  6. #6
    SitePoint Evangelist Worldbuilder's Avatar
    Join Date
    Jan 2004
    Location
    Boston, MA
    Posts
    481
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    NM, I got it. Thanks, fellas!

    Chris


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
  •