473,467 Members | 1,592 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Refreshing Prob

13 New Member
Hello frnds,
Am a new of php.while am refreshing the page the exitsting records also added to database table.
Jul 12 '07 #1
3 1043
nathj
938 Recognized Expert Contributor
Hello frnds,
Am a new of php.while am refreshing the page the exitsting records also added to database table.
Would you be able to post the code that you are hvaing trouble with? There may be some more clues in there that will point us in the right direction.

Remember to use the code tags when you post.

Cheers
nathj
Jul 12 '07 #2
henryrhenryr
103 New Member
Hey

Do you mean that when you refresh, the data in the form is re-submitted by the browser?

If so there are limited solutions. Easiest is to send the form to a new page (rather than to itself). Assuming you have reasons for sending it to itself then you have some options:

1. Use the database to keep track of things. Ensure that data is only submitted once by storing an ID of some sort which you can check each time - only let one submit per ID. You can also compare the data submitted with the data already there and if they're the same, reject the submission.

2. Make fields 'Unique' - add a unique index to your DB columns - bit blunt - DB will return an error if they're the same.

3. (my favourite). You force a reload using the
Expand|Select|Wrap|Line Numbers
  1. header('Location: http://www.thisiste.com/thispage.php')
function. This uses HTTP to redirect the page (to itself to reload). If you want to tell the user about errors, you would need to use cookies or sessions in this case.

If, on the other hand your problem was something else then just ignore me ;)!

Henry
Jul 12 '07 #3
pbmods
5,821 Recognized Expert Expert
Heya, Rajaaa. Welcome to TSDN!

The easiest way to fix this problem is to execute your database code on a different page than your form. When you're finished, redirect back to your form so that the User can see the result.
Jul 12 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

60
by: A.Translator | last post by:
I have been struggling with a page that is based on a table structure (because that is all I am feeling comfortable with at the moment) styled with css. One of the problems I run in to is Opera...
5
by: Jensen Bredal | last post by:
Hello, I need to display self refreshing information on a web page written with asp.net. I would image that the info would be displayed either as part of a user control or a web control. How can...
3
by: Dan | last post by:
Hi, I am trying to refresh the cookie to make sure the timeout is reset by simply calling a blank page on my site. I am doing this because I have an external site hosted in my web that isn't...
0
by: sean.hpr | last post by:
Hi all- I am a vb2005 newb so apologies in advance. Essentially I am having some problems with data refreshing on some of my forms. Background: I have created a project containing a few...
0
Savage
by: Savage | last post by:
I'm making for fun a simple program which format a input file.Input file sustain of person name,lastname and date of birth.Output file si supposed to be forammted as following: NAME ...
2
by: mnacw | last post by:
Can anybody help me to resolve this prob. i have installed Visual Studio 2005 Professional edition. I am working in VB.Net. When I tried to connect to database it is connected but when i make some...
13
by: honey99 | last post by:
Hi! I have to fix a problem in JSP.Actually,i have a JSP page say Ex1.jsp.In this Ex1.jsp i have an anchor tag which links into another JSP page i.e when i click on the link another pop-up window...
1
by: Steve S | last post by:
Hey guys, I'm stuck with using a GridBagSizer (wxPython) in a GUI Dialog and am having a frustrating time with refreshing it properly. Essentially, I've got to refresh the contents of the...
6
by: shankari07 | last post by:
hi guys, I have a form in html which has the city drop down. when clicking the drop down a javascript is called and a file(test.txt) is created and the city is written into the file. Through php...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.