This topic is locked

Pop Up Redirect

1/12/2010 7:58:58 PM
PHPRunner General questions
T
Tempus_Erus author

Hi
I would like to redirect to a page upon clicking the 'ok' button on an 'alert' window
if ($data["data"] == "1")

{

echo "<script>alert('INVALID ENTRY- ')</script>"; .......... How could I redirect from here? Should I use a confirm script or is there an easier way?
}

else
continue with program ..............
could I use the below in the IF/ELSE loop?:
echo '<script language="javascript">confirm("INVALID ENTRY")</script>';
echo '<script language="javascript">window.location = "http://anotherpage.php"</script>';;
Should I use the Header - need to buffer output?
Any help once again appreciated.
Ady

J
Jane 1/13/2010

Hi,
Here is a sample:

if ($data["data"] == "1")

{

?><script>

alert('INVALID ENTRY- ');

window.location = "http://anotherpage.php";;

</script><?php

}

else
T
Tempus_Erus author 1/13/2010



Hi,
Here is a sample:

if ($data["data"] == "1")

{

?><script>

alert('INVALID ENTRY- ');

window.location = "http://anotherpage.php";;

</script><?php

}

else



Jane,
As ever you are spot on.
Thank you for your time.
Ady