[SOLVED] {$_SERVER['PHP_SELF']} inside echo

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
facets
Forum Contributor
Posts: 273
Joined: Wed Apr 13, 2005 1:53 am
Location: Detroit

[SOLVED] {$_SERVER['PHP_SELF']} inside echo

Post by facets »

Hi Gang,

Having trouble putting the {$_SERVER['PHP_SELF'] statement inside an echo.
Error is : Parse error: parse error, expecting `','' or `';'' (form line)
Any ideas?

Cheers, Will.

Code: Select all

echo "<form method=\"post\" action=\"<?php echo {$_SERVER['PHP_SELF']}; ?>\">";
?>

<!--Paper Category -->

<table><tr>
<td width=200px colspan=2 valign=top>Paper Category</td>
<td width=200px colspan=3>

<? listCat(); ?>

</td></tr>
Last edited by facets on Tue May 31, 2005 6:12 am, edited 1 time in total.
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Code: Select all

echo "<form method=\"post\" action=\"".$_SERVER['PHP_SELF']."\">";
Post Reply