PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Sat Aug 24, 2019 5:24 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu May 28, 2009 11:30 am 
Offline
Forum Newbie

Joined: Tue Apr 14, 2009 1:05 pm
Posts: 15


Last edited by Benjamin on Fri May 29, 2009 10:58 am, edited 1 time in total.
Changed code type from text to php.


Top
 Profile  
 
PostPosted: Thu May 28, 2009 11:50 am 
Offline
Forum Contributor
User avatar

Joined: Sun May 24, 2009 5:37 pm
Posts: 355
Location: Chester, UK
Try some basic debugging such as echoing your query and $_POST. I can tell straight off that phone won't work becuase you're using $_Post[phone] instead of $_POST[phone].

Also, it's good practice to escape everything, and to not let PHP assume it's named keys. For example:
"INSERT INTO table (name, date, phone) VALUES ('$_POST[name]', '$_POST[date]'...
becomes:
"INSERT INTO table (name, date, phone) VALUES ('".$_POST['name']."', '".$_POST['date']."'...

You shoudl also escape these entries with something like mysql_real_escape_string()


Top
 Profile  
 
PostPosted: Thu May 28, 2009 1:16 pm 
Offline
Jack of Zircons
User avatar

Joined: Thu Nov 09, 2006 9:30 pm
Posts: 4484
Location: California, USA
Your $_POST array indexes must be enclosed in quotes, like: $_POST['phone'].


Top
 Profile  
 
PostPosted: Thu May 28, 2009 5:14 pm 
Offline
Forum Newbie

Joined: Tue Apr 14, 2009 1:05 pm
Posts: 15


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Google [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group