|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
what would cause my submissions on a news form to be resubmitted if i refresh the page?
ie. i add an article, and refresh the page(fields are now blank) but it adds a copy of what i previously submitted. how do i prevent this? |
|
#2
|
|||
|
|||
|
??? whats the code you are using?? there must be some sort of switch in your code, that is being running when you refresh the page.
|
|
#3
|
|||
|
|||
|
Sounds like he is using (hoping for a lucky guess) $_SERVER['PHP_SELF'] as the form to. Flush it with a header()....
__________________
~ Joe Penn We work for free to help make this a valuable resource on the internet. Do you appreciate the help - did we provide help that will help you prosper and help that has contributed to sharpening your current skill set? Show your appreciation and purchase something from our Amazon Wishlist's - it's simple and a great way to say thank you. |
|
#4
|
|||
|
|||
|
if ($Submit)
{ mysql_connect('localhost','*****','****"); // login into the mysql database server mysql_select_db('essenmin_myDb'); // select the site's database if(empty($title) || empty($text)) exit("You didn't completely fill in the form!"); mysql_query("INSERT INTO news (title,text,date) VALUES ('$title','$text', 'now()')"); ?> <table width=75% border=1> <tr><td>Title<td>Date<td>News <? $query = mysql_query('SELECT * FROM news'); while($news = mysql_fetch_array($query)) { echo "<tr><td>" . $news['title'] . "<td>" . $news['date'] . "<td>" . $news['text']; } //echo "</table>"; unset($Submit); //attempts to fix... echo "Submit: " . $submit; //attempt to fix... } ?> <form method=get action=<?=$PHP_SELF?>> Title:<br> <input type=text name=title size=30> <br> News Article:<br> <textarea name=text rows=4 cols=30 Wrap=hard></textarea> <br> <input type=submit name=Submit value=submit> </form> <? exit() ?> Last edited by papasmurf : December 10th, 2002 at 12:06 AM. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > what would cause this? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|