|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
form making blank entry
I have a form page used to edit data in database (mysql), and the form works fine. But, what it also does is when I even visit the form, without editing a row of data, is it adds a blank row....just by visiting the page.
The page has a session check at the beginning...it is set up similar to Ben's tutorial on making a basic form and database ( PHP and Mysql basics : I think) in that it just displays the data, editable, and repost it. Can also delete it. Anyway, what would cause blank data to be entered ( a post ) without hitting the INPUT button?
__________________
bow wow! |
|
#2
|
|||
|
|||
|
Can you post the source? I would guess you're not doing any checking if the form has been submit before you insert/update the data.. but I can't say for sure without actually seeing the source
__________________
Best Regards, Håvard Lindset |
|
#3
|
|||
|
|||
|
Here is the code...
I am sorry, but I can't seem to get the php code to load all colored...how to do this?
PHP Code:
I hope this works... This is "edit" code. Trying to figure out why it posts from just a visit to the page, and not posting when SUBMIT is pressed. Last edited by littleblackdog : November 27th, 2002 at 11:40 AM. |
|
#4
|
|||
|
|||
|
Sorry to post so long...
This is rather long, sorry for such a long post. I am having trouble...Lindset suggested I might be:
I would guess you're not doing any checking if the form has been submit before you insert/update the data.. I am hoping to get someone to look at the long posted code and see if I am checking for the form....I'm not sure how to do this.. with an if statement... What is happening is the form is posting from just visiting the page, withought hitting "submit". Any ideas? |
|
#5
|
|||
|
|||
|
Re: Here is the code...
Quote:
This is where you problem lies... If you notice, you have an INSERT statement before checking for your "$submit" value... Your validation is done underneath.
__________________
____________________________________________ Developer Shed Weekly Writer | DevArticles Forum Moderator Build Your Own KlipFolio Klip With PHP FrankManno.com - Under Construction Design Interactive Group - Under Construction |
|
#6
|
|||
|
|||
|
Thanks Frankie!
Thanks Frankie! That did it! I was inserting before the submit and that was the problem... too much cut and paste and not enough checking. : )
Wow! Feels good to finish at least part of a project! |
|
#7
|
|||
|
|||
|
No problem... I'm glad to help out!
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > form making blank entry |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|