Connecting Tech Pros Worldwide Forums | Help | Site Map

trying to get a page to close

Newbie
 
Join Date: Apr 2009
Posts: 2
#1: Apr 5 '09
Hi I was not sure where to post this as it is an asp page

basicaly i am using an asp page to send data from a flash form to MS access DB

however when the data is sent the asp page loads as a blank page is there a way for it to auto close after it sends the data

this is the asp
Expand|Select|Wrap|Line Numbers
  1. <%@language = "VBScript" %>
  2. <%
  3.  
  4. strFirst = Request.Form("fname")
  5. strLast = Request.Form("lname") 
  6. strEmail = Request.Form("email")
  7. strMessage = Request.Form("message")
  8.  
  9. MyPath=Server.MapPath("example.mdb")
  10.     Set conn = Server.CreateObject("ADODB.Connection")
  11.     conn.Open "Driver={Microsoft Access Driver (*.mdb)};" & "DBQ=" & MyPath 
  12.  
  13. SQL = "INSERT INTO contacts (FirstName, LastName, Email, Message) VALUES ('"&strFirst&"','"&strLast&"','"&strEmail&"','"&strMessage&"')"
  14. conn.Execute(SQL)
  15. %>
  16.  
thanks mike

Newbie
 
Join Date: Apr 2009
Posts: 2
#2: Apr 5 '09

re: trying to get a page to close


I should have also mentioned on the button in flash I am using

Expand|Select|Wrap|Line Numbers
  1. [on(press){
  2.     getURL("http://localhost/contacts.asp",0,"post");
  3. }
so i am not sure if their is an alternative way of doing this so it does not open the window ?
Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,120
#3: Apr 6 '09

re: trying to get a page to close


This is a classic ASP question.

I think the best way to do this would be to write a message saying something like "Thank you for updating the information" when the update has completed. At that point the user can choose to close the window.

Or you could write a bit of JavaScript that is generated by the ASP code and written into the page that closes the page (using the window.close() method).
Reply