Re: Why won't my echo won't work? [newbie question]
| From: | Andre Dubuc | Date: | Sun, 29 Aug 2004 17:44:01 +0000 |
| Subject: | Re: Why won't my echo won't work? [newbie question] | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-195091@lists.php.net to get a copy of this message | ||
Try using braces around $_POST or any superglobal you use:
print_r($_POST);
print "<br><br>{$_SERVER['REQUEST_METHOD']}";
print "<br><br>{$_POST['username']}";
Works for me.
Hth,
Andre
On Sunday 29 August 2004 01:13 pm, John Nichel wrote:
> FrzzMan wrote:
> > John Nichel wrote:
> >> Bestman4unowwa@aol.com wrote:
> >>> The first two of these 3 echo statements work. But my last echo
> >>> doesn't. 'username' is the name of the element I want to echo. To
> >>> the
> >>> right of each is what I see echoed.
> >>>
> >>> echo $_SERVER['REQUEST_METHOD']; echos -> POST
> >>> echo $_POST; echos -> Array
> >>> echo $_POST['username']; echos -> nothing
> >>
> >> How are you setting $_POST['username']? Let's see the code for the
> >> form.
> >
> > Members in $_POST array are set (mostly) by submitting a form with POST
> > method, make sure your form is not submitting by GET.
>
> The first echo statement from the OP shows that the request method is
> *not* GET.
>
> --
> By-Tor.com
> It's all about the Rush
> http://www.by-tor.com