I am trying to create a link, which will, allow my paginated search to go onto the next page of results including the search term in the url
I get the following error with the link I have created
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/dd615/public_html/searchPage.php on line 47
here is the link
echo "<a href='{$_SERVER['PHP_SELF']}?search=$_GET['search']?pagenumber=1'> FIRST </a>";
any help would be greatly appreciated
You need to wrap the second variable as well:
But it would be better to use proper encoding. So try this:
urlencodeis used to encode any character that is inappropriate in a URL query (according to the application/x-www-form-urlencoded type) andhtmlspecialcharsescapes the HTML special characters.