SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
-
Aug 21, 2006, 21:35 #1
- Join Date
- Sep 2005
- Posts
- 126
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
How can I go to a new page after click ok in alert
Hello,
I know this thread may be more like in the Javascript forum, but I need your help.
My codes are
PHP Code:<?php
....
if (isExistingShowtime($db)) {
?>
<script language="javascript">
<!--
alert("this showtime has been already in my schedule");
-->
</script>
<?php
header("location:$_SERVER[HTTP_REFERER]");
} else {
}
?>
However, when isExistingShowtime($db) is true, it always redirects to the calling page without showing alert.
And if I comment out like this,
PHP Code:// header("location:$_SERVER[HTTP_REFERER]");
Is there any way I can accomplish my goal?
Thanks
-
Aug 21, 2006, 22:03 #2
- Join Date
- Mar 2006
- Posts
- 6,132
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
use javascript to do the redirect. like you said, this belongs in the javascript forum.
the only thing your using php for is to decide whether or not to echo the javascript.
Bookmarks