ASP Request.QueryString

hooks

Registered User.
Local time
, 17:30
Joined
Aug 13, 2004
Messages
160
Hey all. Once again I am in a pickle.

I have 2 asp pages and 1 html page.
The pages are Page1.asp, Page2.asp, Page3.htm

Here is what im doing. Page1.asp is passing a variable to page2.asp. On page2.asp the user enters in some data and resubmits the page to itself. After the page has been resubmitted the page runs a couple of functions then automatically submits and passes the data that the user entered to a php page on the internet which i have no control over. The php page process the data and redirects the user to Page3.htm which is basically a confirmation page.

I hope that makes sense.

this is all working fine.

The problem that i am having is that if the user presses the back button while on page3.htm page2.asp runs the functions and automatically submits the page again to the php page and they end up back where they started.

Below is a summary of what is happening
Code:
'Starting with Page2.asp
     
     'Start by getting the variable passed by Page1.asp
     dim mID
     mID =  Request.QueryString("myID")

'Now see if the user has entered any data in the text box on this page
If request.form("message") = "" Then
    'Display the text box for the user to enter the data
   <form method="post" action="Page2.asp">
    Submit
   </form>

Else
    'The user has already entered data in this form and has been posted back to itself

    'this is the code that is being run when the user presses the back button on Page3.htm

    RunMyFunctions
    <form method="post" action="InternetWebPage.php">
    'Submit the page to the php web page.
    'Im using a Java function to automatically submit the page to the php page.
    </form.
End If

Anyone have any ideas.

I could maybe get rid of the Java function that is submitting the page but the user would have to submit the page 2 times and i don't like that.

As always thanks a bunch.
 
Hi,

Could you not put in the page_onload event
If page.ispostback = false then
'submit form
Else
'return to page1.asp

Just started learning asp.net 2.0 so may not be correct. But in theory this would only pass the information to the php page the first time the form is submitted (when ispostback = false).

Cheers
BF
 
I am using ASP. I think i am going to convert the site to ASPX in the future.

thanks
 

Users who are viewing this thread

Back
Top Bottom