I can't get variables from forms when I use post

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
AdamK9
Forum Newbie
Posts: 3
Joined: Mon Jul 17, 2006 6:51 pm

I can't get variables from forms when I use post

Post by AdamK9 »

I am trying to get variables from a form and I want to use post instead of get. I tried using get and I was able to get the variables but when I use the post option I can no longer access the variables. I tried using $_POST['']; but it still wouldn't work for me.

Heres the form:

Code: Select all

<form action="?" method="post" style="margin-bottom:0" name="FBForm" enctype="text/plain">
						   		 <input name="action" type="hidden" value="feedback">
						   		 <textarea class="Feedback" name="message" wrap="physical"></textarea><br />
								 <input class="Feedback" type="submit" name="SendFeedback" value="Send">
						   </form>

and here is the php code where I am trying to get the variable $message:

Code: Select all

$Query = "INSERT INTO feedback VALUES ('', '$message')";
** register_globals = on
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Code: Select all

$_POST['message'];
Register globals is off.
AdamK9
Forum Newbie
Posts: 3
Joined: Mon Jul 17, 2006 6:51 pm

Post by AdamK9 »

actually register globals is on and i tried using $_POST while register globals was on and off and both times it wouldn't work for me.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

get rid of this:

Code: Select all

enctype="text/plain"
AdamK9
Forum Newbie
Posts: 3
Joined: Mon Jul 17, 2006 6:51 pm

Post by AdamK9 »

Thank you
Post Reply