Newb question won't post from a input field

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
Jhorra
Forum Newbie
Posts: 24
Joined: Mon Aug 18, 2003 1:00 am

Newb question won't post from a input field

Post by Jhorra »

I think that's a good description, and I apologize if this is a dumb question. I have been coding in php for exactly 1 day now.

Ok first page has text input fields for a sign up page. When you submit it runs this:

<form action="confirm.php" method=post>


The specific field where I am trying to pull from:
<INPUT TYPE="Text" NAME="user" SIZE="15" MAXLENGTH="30">
<b>Username</b>


It then goes to the confirm page:

At the top I have in php quotes:
//create short variable names
$user = $http_post_vars['user'];

Then down where I want it to post in php quotes I have:
echo $user;


I get no error message, and where I should see the entered username it's blank. I am using examples from my book, so I am almost positive the code is correct. Any suggestions?

Also I tried to read the stickies up top and I hope this is in the correct formatting. Please correct me if I have erred.

Edit: I originally tried this with the medium version:
//create short variable names
$user = $_post['user'];

I thought maybe the php version was older so I went with the long version. I just checked the php version and it is 4.3.1
User avatar
delorian
Forum Contributor
Posts: 223
Joined: Sun May 04, 2003 5:20 pm
Location: Olsztyn, Poland

Post by delorian »

The global tables are written in capitals. http://www.php.net/manual/en/language.v ... efined.php
qartis
Forum Contributor
Posts: 271
Joined: Sat Dec 14, 2002 4:43 pm
Location: BC, Canada
Contact:

Post by qartis »

Yea, in PHP, $VAR is not the same as $var (case-sensitive variable names)

Superglobal arrays are:

_POST
_GET
_SESSION
_COOKIE
_REQUEST
_SERVER

et al.
Post Reply