|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
It keeps on posting..help
<FORM ACTION="<?=$PHP_SELF?>" METHOD="POST" NAME="newsentry">
when i used this method, a form that will post to itself, it seems to add new newsentry when i refresh my browser. Can anyone help me how to prevent this |
|
#2
|
||||
|
||||
|
You have to separate the posting code from the display code, something like the following:
PHP Code:
|
|
#3
|
|||
|
|||
|
how about this
if(!empty($_POST['submit']))
{ //insert to database // Display inserrt message } else { ?> <form method="post" action="" name="ot"> <input type="text" name="action" value="New Entry"> <input type="submit" name="ADD" value="SAVE"> </form> <? } //When you refresh your browser after submitting new entry, it will submit again.. Thank you for any replies |
|
#4
|
||||
|
||||
|
Why not try it the way I first recommended? When I changed !empty($_POST['submit']) in your code to just $_POST, it worked like a charm.
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > It keeps on posting..help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|