473,323 Members | 1,551 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

how to restrict inserting data into db while html page refreshing

45
hello everyone,

i need your help.

i m using update query for a table to update data. i want to insert data when submit button is pressed but when page is refeshed the table data is automatically updated the value. now i want to restrict automatic update except submit button is pressed.


how to do it ?
can any one please help me out.

Thanks
Aug 2 '08 #1
2 1713
Hello,

This should be done on the server side, like so:
Immediately after you insert the date, redirect the user to a third page using the HTTP "Location" header so when they refresh the page they'll get the third page and nothing happens (because the second page added the data to the database and moved on the the third).

You could also redirect the user with JavaScript on the page that loads after the form is submitted. Send them to a "thank you" page or something. You could also try to set the current url to the current url (yes, it's redundant, i know) which just causes the page to reload without doing anything so when the user refreshes, the last action will be performed by the browser: load the url without sending anything to the server.

If you don't understand, let me know and I'll post an example.

Hope this helps,
Tom
Aug 2 '08 #2
boss1
45
Hello Tom

Thanks for your co-operation.If u please provide me an example,it will be more clear to me. But one thing i need to call the self page agian.

Thanks
Aug 3 '08 #3

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

Similar topics

1
by: ATH0 | last post by:
Hi! Well, i think you know what im going to ask :-)) I have MySql db with some products ( with pictures and description ) and i want to make update and show of each picture. Example: picture...
31
by: Greg Scharlemann | last post by:
Given some recent success on a simple form validation (mainly due to the kind folks in this forum), I've tried to tackle something a bit more difficult. I'm pulling data down from a database and...
28
by: gc | last post by:
Hi, What is the purpose of the restrict keyword? gc
2
by: altergothen | last post by:
Hi there I am a newbie to ASP.Net - Please Help! I am trying to insert the values of my variables into a database. If I try the following it works perfectly: string insertQuery = "INSERT into...
1
by: Jennyfer J Barco | last post by:
Hello I have a datagrid and a linkbuttom in the datagrid that says Picture, every time I click on the link "Picture" my program opens a popup window showing a picture of the item the selected and...
21
by: Niu Xiao | last post by:
I see a lot of use in function declarations, such as size_t fread(void* restrict ptr, size_t size, size_t nobj, FILE* restrict fp); but what does the keyword 'restrict' mean? there is no...
6
by: planetthoughtful | last post by:
Hi All, I have a C# ASP.NET page that submits back to itself to insert details from a form into a database table. When / if the user refreshes the page (and gets the standard warning that POST...
25
by: bseakgano | last post by:
I have developed a intranet . Using HTML , SQL and ASP . I have created a table with SQL is just fine . And design a form is just looks fine to me . But when I try to insert Data into the SQL I just...
4
by: sialater | last post by:
Hello, I realise there are a lot of topics related to this problem but many of what I have found has run cold or unresolved. What I have is an addressbook clone where there are groups which have...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.