I want to use $_SERVER['PHP_SELF'] in the following script instead of $PHP_SELF but I keep getting a parse error or unexpected '&' error on that line no matter how I try to write it. Any advice?

if ($s>=1) { 
$prevs=($s-$limit);
print "&nbsp;<a href='$PHP_SELF?s=$prevs&q=". stripslashes($var)."'>&lt;&lt; 
Prev 10</a>&nbsp&nbsp;";
}
    print '&nbsp;<a href="' . $_SERVER['PHP_SELF'] . '?s=' . $prevs . '&q=' . stripslashes($var) . '">&lt;&lt;Prev 10</a>&nbsp&nbsp;'; 
    

      Thanks a lot, that worked.

      Can you give me a brief explanation, or a link that describes why you use the different syntax for variables? I've seen scripts that look like ". $variable ." or \"&#37;$variable%\" and a bunch of other different ways and I dont know when I would use one or the other. I tried to google it but nothing relevant comes up.

      I guess I should invest in a decent book too. Thanks again.

        Write a Reply...