Jump to content

[SOLVED] Parse error


halfpint

Recommended Posts

The ( had nothing to do with it. echo is a language construct not a function, hence does not require () around its arguments (this is however beside the point).

 

The problem was the fact that you had unescaped double quotes within a double quote encapsulated string. In order to use double quotes within a double quote encapsulated string they need to be escaped (using the \ (backslash) character). Otherwise, you could have used single quotes.

 

Some working examples of how your code could have been written.

 

<?php

  echo "<a href=\"page.php?page=memberlist&p=$prev_page\">< Prev</a>";
  echo "<a href='page.php?page=memberlist&p=$prev_page'>< Prev</a>";
  echo '<a href="page.php?page=memberlist&p=' . $prev_page . '">< Prev</a>';

?>

Link to comment
https://forums.phpfreaks.com/topic/107299-solved-parse-error/#findComment-550544
Share on other sites

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.