Welcome to WebmasterWorld Guest from 54.196.233.208

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

php with message/alert box

     
5:52 am on Jul 14, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 14, 2004
posts:197
votes: 0


in my php site, i have a form..after user fill up the information and click on submit button..i want a message box to be pop up "Information updated" with an OK button..after user click on the OK button, they will link to other page...can this be done with php? or other language? any idea? any example?
6:28 am on July 14, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:May 10, 2004
posts:80
votes: 0


Easiest way would probably be in javascript, take a look at this:

[web-wise-wizard.com...]

8:19 am on July 14, 2004 (gmt 0)

New User

10+ Year Member

joined:Apr 26, 2004
posts:22
votes: 0


Hi, yllai.

Here's how you do it from within PHP (but in reality this is javascript!)

Assuming that you have variable $success (TRUE on success) that holds whether the information was updated successfully.


if ($success) {
echo "<script>alert('Information updated')</script>";
echo "<script>navigate('other.php')</script>";
exit();
} else {
//....failed to update info
}

Will not work if your visitor's browser have javascript disabled.

- John Erazo