Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
php not picking up hidden html field
Old 02-13-2008, 11:19 PM php not picking up hidden html field
Sharon_leic's Avatar
Super Talker

Posts: 115
Name: Sharon
Location: Leicester, uk
Trades: 0
Hi !

my php process for wont pick up on a hidden field

this is a snippet from my html

HTML Code:
<input type="hidden" name="marital" value="Couple" />

Sex?
<select name="asex">
<option>Prefer not to say</option>
<option>Male</option>
<option>Female</option>
</select><br><br>
and this is a snippet from my php

PHP Code:
$asex $_POST['asex'];
$mari $_post['marital'];
mysql_query("INSERT INTO Profiles (asex, marital) VALUES ('$asex', '$mari') ") or die(mysql_error()); 
its adding all my fields where the user has to select but not the hidden field, could you give me an idea as to why please?

Thanks

Shaz x
__________________
mysql_connect("localhost", "brain", "sharon") or die(mysql_error());
mysql error: brain doesn't exist!

Last edited by Sharon_leic; 02-13-2008 at 11:20 PM..
Sharon_leic is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-13-2008, 11:46 PM Re: php not picking up hidden html field
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
I believe you just need "$_post" to be all uppercase: "$_POST"
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 02-13-2008, 11:46 PM Re: php not picking up hidden html field
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
Change $_post['marital'] to $_POST['marital']
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 02-14-2008, 12:05 AM Re: php not picking up hidden html field
Sharon_leic's Avatar
Super Talker

Posts: 115
Name: Sharon
Location: Leicester, uk
Trades: 0
Oh well bugger me!
I knew it should be uppercase but never noticed it wasn't.. omg! nearly 2 hours and i didn't spot it lol

thanks both

Shaz x
__________________
mysql_connect("localhost", "brain", "sharon") or die(mysql_error());
mysql error: brain doesn't exist!
Sharon_leic is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to php not picking up hidden html field
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15230 seconds with 12 queries