473,320 Members | 2,048 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,320 software developers and data experts.

Automatically close the Window

36
once the feedback is submitted the thank.html popups. however, i want this popup to only be displayed for 3 seconds and then for this window to automaticaly close it self. below is the code for thank.html

[HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<script language="javascript">
settimeout("window.close()",500)
</script> </head>
<body>
Thanks for your Feedback
</body>

</html>[/HTML]

here is the code for the feedback.php file:

[PHP]// ------------- CONFIGURABLE SECTION ------------------------

// $mailto - set to the email address you want the form
// sent to, eg
//$mailto = "youremailaddress@example.com" ;

$mailto = 'atiqisthebest@hotmail.com' ;

// $subject - set to the Subject line of the email, eg
//$subject = "Feedback Form" ;

//$subject = "Feedback by $name" ; ***MOVED to line 78***

// the pages to be displayed, eg
//$formurl = "http://www.example.com/feedback.html" ;
//$errorurl = "http://www.example.com/error.html" ;
//$thankyouurl = "http://www.example.com/thankyou.html" ;

$formurl = "http://miraj.atiq.eu/index.html" ;
$errorurl = "http://atiq.eu/error.html" ;
$thankyouurl = "http://miraj.atiq.eu/" ;

$uself = 0;

// -------------------- END OF CONFIGURABLE SECTION ---------------

$headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ;
$name = $_POST['name'] ;
$email = $_POST['email'] ;
$comments = $_POST['comments'] ;
$http_referrer = getenv( "HTTP_REFERER" );

$subject = "Feedback by $name" ;

if (!isset($_POST['email'])) {
header( "Location: $formurl" );
exit ;
}
if (empty($name) || empty($email) || empty($comments)) {
header( "Location: $errorurl" );
exit ;
}
if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) {
header( "Location: $errorurl" );
exit ;
}

if (get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
}

$messageproper =

"This message was sent from:\n" .
"$http_referrer\n" .
"------------------------------------------------------------\n" .
"Name of sender: $name\n" .
"Email of sender: $email\n" .
"------------------------ COMMENTS ------------------------\n\n" .
$comments .
"\n\n------------------------------------------------------------\n" ;

if(mail($mailto, $subject, $messageproper,
"From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep .
"X-Mailer: feedback.php 2.08" ))

{
?>
<script language="javascript">
window.open ("thank.html","mywindow","location=1,status=0,scro llbars=0,width=400,height= 400");
</script>
<?

$thankyouurl = 'http://www.miraj.atiq.eu';
echo '<meta http-equiv="refresh" content="5;url='.$thankyouurl.'">';
}

?>[/PHP]

Any help would be greatly appreciated!

Thanks
Apr 6 '08 #1
1 2649
acoder
16,027 Expert Mod 8TB
settimeout should be setTimeout (JavaScript is case-sensitive).

3 seconds = 3000 milliseconds.
Apr 7 '08 #2

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

Similar topics

2
by: Thang Nguyen | last post by:
Hi, my page contains an applet. When I click on a link on the page, the applet will be launched.Now I need my page can be automatically closed when I close my applet.I can call the script from my...
4
by: jadiyo | last post by:
Hi, I've read many questions about how to automatically open a new window from a page using the JavaScript onLoad command. Unfortunately, due to the web application framework being used...
0
by: Jack Addington | last post by:
I have a 'quickadd' type window for doing quick data entry. The window is launch from a MDI child and is suppose to be a re-sizable popup/child window. This is an excel type datagrid for doing...
4
by: Sileesh | last post by:
Hi I have a btn in Parent.aspx page . On server_click() of the Btn, i am opening a new window called the child.apsx window. Child window also have a Btn. On serverClick of this Btn, I perform...
1
by: Nico Grubert | last post by:
Dear Python developers, I use a short python script in order to run an external application plus to open a browser displaying a default page. My Setup: Python 2.4.3. / Windows2000 #...
3
by: rsaikamesh | last post by:
Hi, I am using gtkmm 2.4 to create UI in my c++ application.My operating system is linux(ubuntu).I have barcode scanner which is connected to the serial port(/dev/ttyS0). What I have to do in my...
6
by: Doc John | last post by:
Assuming I have several child Forms open (not maximized) in my MDI Form, when I maximize any of them and then close it, all my other Forms automatically maximize. How come? Is there an easy...
4
nitindel
by: nitindel | last post by:
Hi Guys... I am looking for a functionality of closing the POP UP window that i have opened from a Parent window....Whenver i Close the Parent window.. I mean to say... Whenver i close...
7
by: sumanta123 | last post by:
Dear All, How will we do in JSP page on closing the parent window the child windows should close automatically. I will show my code Please i will show you my code. For HTML link function...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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)...
0
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...
0
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...

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.