On 5/4/06, Brad Bonkoski <[EMAIL PROTECTED]> wrote:
try this:
echo "<TD WIDTH=\"25%\" ALIGN=\"CENTER\">
<A
HREF=\"javascript:open_window('".$_SERVER['PHP_SELF']."?action=view_record&userid=$userid');\">View</A>
-------------------------------------------^-------------------------------^
concatenate the $_SERVER variable to the string...
Or wrap the variables with curly braces so that PHP knows what's a
variable and what's not:
[php]
echo "<TD WIDTH=\"25%\" ALIGN=\"CENTER\"> <A
HREF=\"javascript:open_window('{$_SERVER['PHP_SELF']}?action=view_record&userid=$userid');\">View</A>
[/php]
Personally, I get tired (and confused) when having to escape all of
those quotes like in the string you're trying to echo above. Perhaps
you'd consider HEREDOC as an alternative approach:
[php]
echo<<<HEREDOC
<TD WIDTH="25%" ALIGN="CENTER"> <A
HREF="javascript:open_window('{$_SERVER['PHP_SELF']}?action=view_record&userid=$userid');">View</A>
HEREDOC;
[/php]
If you haven't read about HEREDOC before, RTFM because there are some
rules you should know about it...
HTH,
John W
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php