Re: PHP_SELF Undefined
| From: | Erik Price | Date: | Mon, 18 Feb 2002 23:02:46 +0000 |
| Subject: | Re: PHP_SELF Undefined | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-85302@lists.php.net to get a copy of this message | ||
On Monday, February 18, 2002, at 05:50 PM, Narvaez, Teresa wrote:
When I execute the code below, why is PHP_SELF undefined? I will appretiate any help on this. I can get its value by:It hasn't been pulled from the $_SERVER array. It worked for you when you did it the first way, so try doing it that same way in the code: <form method=\"post\" action=\"" . $_SERVER['PHP_SELF'] . "\"> Note that I had to "jump out" of the string and concatenate it to the variable, because PHP doesn't let you just use $_* variables in the middle of a string. I also made sure to "jump back into" the string to finish the HTML form tag. If you don't like doing it this way, do something like $PHP_SELF = $_SERVER['PHP_SELF']; $form_block = "<form method=\"post\" action=\"$PHP_SELF\">"; HTH Erik ---- Erik Price Web Developer Temp Media Lab, H.H. Brown pricee@hhbrown.comecho $_SERVER["PHP_SELF"]; Thanks in advance! -Teresa<HTML> <HEAD> <TITLE>Feedback</TITLE> </HEAD> <BODY> <? $form_block = " <FORM method=\"POST\" action=\"$PHP_SELF\">^^^^^^^^^