Jump to content

Error with phpfreaks tutorial


turbocueca

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.
Link to comment
https://forums.phpfreaks.com/topic/5787-error-with-phpfreaks-tutorial/
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.

Archived

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

×
×
  • Create New...

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.