Jump to content


Photo

Error with phpfreaks tutorial


  • Please log in to reply
2 replies to this topic

#1 turbocueca

turbocueca
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts

Posted 25 March 2006 - 05:51 PM

    if($page > 1)
    {
        $prev=($page-1);
        echo "<a href="".$_SERVER['PHP_SELF']."?page=$prev"><<Previous</a> ";
    }
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.

#2 Gast

Gast
  • Members
  • PipPipPip
  • Advanced Member
  • 131 posts
  • LocationSouth East England

Posted 25 March 2006 - 06:02 PM

[!--quoteo(post=358293:date=Mar 25 2006, 05:51 PM:name=turbocueca)--][div class=\'quotetop\']QUOTE(turbocueca @ Mar 25 2006, 05:51 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
    if($page > 1)
    {
        $prev=($page-1);
        echo "<a href="".$_SERVER['PHP_SELF']."?page=$prev"><<Previous</a> ";
    }
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:

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

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.
OS and Internet Specs:
Windows XP (with SP2), 1680x1050, PHP 4, MySQL 3, Internet Explorer 6 &7 /FireFox 2.0/Opera 9.2

Tutorials:
Simple Introduction to AJAX and XMLHttpRequest
Creating Live Data with AJAX Making a Google Suggest like application

#3 turbocueca

turbocueca
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts

Posted 25 March 2006 - 07:38 PM

thx




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users