General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old December 9th, 2002, 09:55 PM
papasmurf papasmurf is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 10 papasmurf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question what would cause this?

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?

Reply With Quote
  #2  
Old December 9th, 2002, 10:30 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
??? 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.

Reply With Quote
  #3  
Old December 9th, 2002, 10:38 PM
jpenn jpenn is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Washington, DC
Posts: 317 jpenn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 3 sec
Reputation Power: 6
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.




Reply With Quote
  #4  
Old December 10th, 2002, 12:00 AM
papasmurf papasmurf is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 10 papasmurf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > what would cause this?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway