-
[RESOLVED] Posting data
Friends,
I am on the way developing a website in ASP. I am using MS Access database.
In my home page, there is a textbox and a submit button. It is used to register a user's email address for receiving the newsletter. In the submit button, the action is to post the text to another asp page named newsletter.asp. I am going to write the code for entering the email to the database. So after adding it to the database, how can I load the webpage that the user was viewing before that...???
Also, after adding it to the database, I used response.write("Success). But I want to display a page which is same as the my other pages and the text should be placed in the middle of the page.
How can I do that...????:eek:
-
Re: Posting data
You can use the HTTP_REFERER server variable on the 'second' page, store it somewhere and after you submit the information to the database, Response.Redirect to the HTTP_REFERER value.
-
Re: Posting data
Pal, What is the use of that variable?
I am using a free hosting service. So I dont know whether they will allow me or not.
Is there any other way? I mean while posting the data, a hidden text is passed to the other page. And when the process is over, using response.Redirect that page is loaded. Is that possible?:)
-
Re: Posting data
What mendhak suggested is pretty straight forward when using ASP.
Code:
<%
Dim strCameFrom
strCameFrom = Request.ServerVariables("HTTP_REFERER")
'Add info to the database
Response.Redirect strCameFrom
%>
-
Re: Posting data
Thanks for all your reply, guys...:)