Jump to content

Archived

This topic is now archived and is closed to further replies.

turbocueca

Error with phpfreaks tutorial

Recommended Posts

[code]    if($page > 1)
    {
        $prev=($page-1);
        echo "<a href="".$_SERVER['PHP_SELF']."?page=$prev"><<Previous</a> ";
    } [/code]
Lines 26-30

[a href=\"http://infocenter.awardspace.com/pages.php\" target=\"_blank\"]http://infocenter.awardspace.com/pages.php[/a]

there's an error I can't repair.

Share this post


Link to post
Share on other sites
[!--quoteo(post=358293:date=Mar 25 2006, 05:51 PM:name=turbocueca)--][div class=\'quotetop\']QUOTE(turbocueca @ Mar 25 2006, 05:51 PM) [snapback]358293[/snapback][/div][div class=\'quotemain\'][!--quotec--]
[code]    if($page > 1)
    {
        $prev=($page-1);
        echo "<a href="".$_SERVER['PHP_SELF']."?page=$prev"><<Previous</a> ";
    } [/code]
Lines 26-30

[a href=\"http://infocenter.awardspace.com/pages.php\" target=\"_blank\"]http://infocenter.awardspace.com/pages.php[/a]

there's an error I can't repair.
[/quote]

Its your quotes. It should be:

[code]    if($page > 1)
    {
        $prev=($page-1);
        echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$prev\"><<Previous</a> ";
    } [/code]

And the same for the next link if it is the same problem. You need to escape the actual quote used for the HTML tag.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.