Forms

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
F.T.
Forum Newbie
Posts: 2
Joined: Sat Nov 30, 2002 4:16 am

Forms

Post 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>
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post 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
User avatar
horgh
Forum Newbie
Posts: 23
Joined: Mon Oct 21, 2002 9:50 am
Location: GER
Contact:

Post by horgh »

try to find out something about $_GET and $_POST variables

so echo $_POST['username']; should work
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post 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
User avatar
BigE
Site Admin
Posts: 139
Joined: Fri Apr 19, 2002 9:49 am
Location: Missouri, USA
Contact:

Post by BigE »

And still... I see nothing pointing to the manual, heh, php.net/variables.external and php.net/variables.predefined Hope that helps.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

User avatar
BigE
Site Admin
Posts: 139
Joined: Fri Apr 19, 2002 9:49 am
Location: Missouri, USA
Contact:

Post 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.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

just kidding...
and of course the short links do work, they just perform an extra search query (neglectable ;) )
Post Reply