Page 1 of 1

Forms

Posted: Sat Nov 30, 2002 4:16 am
by F.T.
Hello
I have a problem with forms and decided to test an example from a book. It didn“t work??

<HTML>

<FORM>
Write your name:<BR>
<INPUT TYPE=TEXT NAME=username><BR><BR>
<INPUT TYPE=SUBMIT VALUE="Print">
</FORM>

<BR><BR>
You wrote:

<?php

echo ($username);
?>

</HTML>

Posted: Sat Nov 30, 2002 7:14 am
by BDKR
I suspect that this is related to one of those stickys up at the top of the thread listing page.
Here is the link.

viewtopic.php?t=511

It doesn't work becuase you are most like applying a deprecate (old) way of doing things to a more up to date version of PHP.

Also, you may wish to brush up on your html. That form tag should have some additional information. Action and Method properties in particular.

In short, I"m not giving you the answer, but instead, the ability to get the answer.

Cheers,
BDKR

Posted: Sat Nov 30, 2002 9:10 am
by horgh
try to find out something about $_GET and $_POST variables

so echo $_POST['username']; should work

Posted: Sat Nov 30, 2002 10:11 am
by BDKR
horgh wrote: try to find out something about $_GET and $_POST variables
You did just what I told him I wasn't going to do.

Oh well.....

Cheers,
BDKR

Posted: Sat Nov 30, 2002 12:43 pm
by BigE
And still... I see nothing pointing to the manual, heh, php.net/variables.external and php.net/variables.predefined Hope that helps.

Posted: Sat Nov 30, 2002 10:52 pm
by volka

Posted: Sat Nov 30, 2002 11:33 pm
by BigE
the reason I don't do that is because I preffer for people to use a mirror of php.net instead of http://www.php.net. Besides, there is nothing wrong with the short links to the manual pages. I use them quite frequently.

Posted: Sun Dec 01, 2002 12:57 am
by volka
just kidding...
and of course the short links do work, they just perform an extra search query (neglectable ;) )