http://pastebin.com/m5f0ef9f3 - Script can be found on this link.
I am trying to make my script go to a preview page of the users inputted data before actually submitting the code into the database. When they press the submit button it is supposed to insert that data and present them with a brief message letting them know that everything was inserted. Instead of it doing that though, when the submit button is pressed all it does is "restart" the script, and when I check the scripts table, nothing no data has been inserted. Can anyone explain to me why it is doing this?
Problems inserting data into mysql
Moderator: General Moderators
Re: Problems inserting data into mysql
guess i have to go to a more advanced forum, thanks anyways.
Re: Problems inserting data into mysql
have gone through your code and here are the few things i failed to find:
1. In the form where is the submit button other than preview?
2. Where are you assigning posted values of the input fields?
1. In the form where is the submit button other than preview?
Code: Select all
<input type="submit" name="preview" value="Preview" />
<input type="submit" name="submit" value="submit" /> //this is not present
Code: Select all
$sname = $_POST['sname'];//similiar lines..
- jlising
- Forum Commoner
- Posts: 33
- Joined: Mon Mar 19, 2007 1:48 am
- Location: Pampanga, Philippines
- Contact:
Re: Problems inserting data into mysql
You can use sessions for you to store the data posted in temporary locations.