TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 05-30-2005, 06:37 PM   #1 (permalink)
The Wanderer
 
Join Date: May 2005
Location: Maine|USA
Posts: 17
Thanks: 0
Ogden2k is on a distinguished road
Default Submission form issues

I have created a MySQL DB, stuff, it contains two a table named xbox. There are multiple fields that contain Title, publisher, purchased, etc.

I can successfully insert the title into the DB, but when I try to submit multiple input fields (from the web form) it only adds the publisher, not the title.

Here's the code:
PHP Code:
// If info has been submitted add it to the DB.
if (isset($_POST['title'])) {
 
$title $_POST['title'];
 
$sql "INSERT INTO xbox SET
  title='
$title'";
 }
 
if (isset(
$_POST['publisher'])) {
 
$publisher $_POST['publisher'];
 
$sql "INSERT INTO xbox SET
  publisher='
$publisher'";
 if (@
mysql_query($sql)) {
  echo 
'<p>Your info has been added.</p>';
 } else {
  echo 
'<p>Error adding submitted info: ' mysql_error(). '</p>';
 }

__________________
TechieHQ
Send a message via AIM to Ogden2k
Ogden2k is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Form validation help 3gg1 General 0 10-06-2006 03:16 PM
Form Processing William Tips & Tricks 8 04-17-2005 03:24 PM
Form Processing Help Veolus Absolute Beginners 3 04-16-2005 04:16 AM


All times are GMT. The time now is 07:19 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design