By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,828 Members | 1,238 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,828 IT Pros & Developers. It's quick & easy.

Nasty Values :-)

P: n/a
Hi!
I have installed PHP 4.3.7 on Apache 2.0 on RH9.
Everything seems to go well( When I run <?php phpinfo() ;?> it works)
but I can't manage up with values.Even in the simplest programm, I
can't write out TEXTBOX's value:
<HTML>
<FORM>
Please type your name here:<BR>
<INPUT TYPE=TEXT NAME=username><BR><BR>
<INPUT TYPE=SUBMIT VALUE="Submit data">
</FORM>
<BR><BR>
You typed:
<?php
echo($username);
?>
</HTML>

Output is:
You typed:

what it wrong?
Thanks.
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Michael wrote:
[snip]
<?php
echo($username);
Try
echo $_GET['username'];
?>
</HTML>

Output is:
You typed:

what it wrong?


register_globals is wrong.

http://www.php.net/manual/en/security.globals.php
--
USENET would be a better place if everybody read: | to email me: use |
http://www.catb.org/~esr/faqs/smart-questions.html | my name in "To:" |
http://www.netmeister.org/news/learn2quote2.html | header, textonly |
http://www.expita.com/nomime.html | no attachments. |
Jul 17 '05 #2

P: n/a
Michael wrote:
I have installed PHP 4.3.7 on Apache 2.0 on RH9. Everything seems to
go well( When I run <?php phpinfo() ;?> it works) but I can't manage
up with values.Even in the simplest programm, I can't write out
TEXTBOX's value:
<HTML>
<FORM>
Please type your name here:<BR>
<INPUT TYPE=TEXT NAME=username><BR><BR>
<INPUT TYPE=SUBMIT VALUE="Submit data">
</FORM>
<BR><BR>
You typed:
<?php
echo($username);
?>
</HTML>
This is all in one page?
Output is:
You typed:

what it wrong?


$username is not set until the user submits the data, either by pressing
the submit button or by other means. You need to have an action with the
form, e.g.,

<FORM action="myPhpScript.php">
....
</FORM>

on a web page. Enter a name in that page, e.g., "Joe Schmoe", and press
the submit button. Then, myPhpScript.php will print "You typed: Joe
Schmoe" (assuming no errors in your code).

--
Brian (remove "invalid" to email me)
http://www.tsmchughs.com/
Jul 17 '05 #3

P: n/a
Thanks Guys!

It seems to work now
;-)
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.