Hi everyone, thanks for reading and replying to this dummy question.

I have a script that open a javascript alert box -
what I would like to do is after clicking the "OK" button is to direct the user to a new page.

the alert is working, just when I click the ok button, nothing happens.
Any help would be aprreciated,
thanks

echo '<script type="text/javascript"> setTimeout(function() { alert("my message" window.location = "/new-page.php";); }, 1000);';

Recommended Answers

try this

<?php
echo ("<SCRIPT LANGUAGE='JavaScript'>
    window.alert('Succesfully Updated')
    window.location.href='http://someplace.com';
    </SCRIPT>");

?>
Jump to Post

Hi,

Syntax error :-)

setTimeout(function(){alert("my message");location.replace("/new-page.php");},1000);

Jump to Post

All 5 Replies

try this

<?php
echo ("<SCRIPT LANGUAGE='JavaScript'>
    window.alert('Succesfully Updated')
    window.location.href='http://someplace.com';
    </SCRIPT>");

?>

Hi,

Syntax error :-)

setTimeout(function(){alert("my message");location.replace("/new-page.php");},1000);

@IIM... This worked a treat thank you...

Hi how can i set the timeout function on

<?php
echo ("<SCRIPT LANGUAGE='JavaScript'>
    window.alert('Succesfully Updated')
    window.location.href='http://someplace.com';
    </SCRIPT>");
?>

thanks a lot it really helped me...:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.