PHP error: “syntax error, unexpected T_STRING, expecting ',' or ';'” on my site

I get the following syntax error while giving this code

<?php
if($pages >= 1){

    for($x=1;$x<=$pages;$x++){

        echo '<a href="<?php echo $row['id']; ?>?page='.$x.'">'.$x.'</a>';
    }
}
?>

Answers


You are opening another <?php block in echo.

echo '<a href="'.$row['id'].'?page='.$x.'">'.$x.'</a>';

Use

echo '<a href="'. $row['id'].'?page='.$x.'">'.$x.'</a>';

Need Your Help

ios4 multitasking controls & background Audio features question

audio ios4 multitasking

I'm pretty new to IOS4 audio/multitasking and i cant find an answer on this topic:

Emacs Lisp: Can't set any value to variable named 's'

emacs lisp elisp

This is rather queer. I can't set any value to a variable if it is named 's' in an interactive session: