Destramic Posted December 15, 2014 Share Posted December 15, 2014 hey guys im interested in the jquery notification scripts...where a user registers and then gets redirected to homepage where a notification pops up saying "thank you for registering". now ive looked at a few examples online but im clueless to how each individiual notification pops up is it activated by the refering url? would be good to know...but thats the only way to me that makes sense on how it works. thank you Link to comment https://forums.phpfreaks.com/topic/293118-notification-script/ Share on other sites More sharing options...
Tom8001 Posted December 17, 2014 Share Posted December 17, 2014 <script type="text/javascript"> window.location.href='example.php'; // Redirect x = onload = alert("Thanks for registering!"); // Alert //You may have to put this in the page you have redirected to. </script> Do you mean like this? Link to comment https://forums.phpfreaks.com/topic/293118-notification-script/#findComment-1499903 Share on other sites More sharing options...
CroNiX Posted December 17, 2014 Share Posted December 17, 2014 You could store a message in session before redirecting, and then on the page you're redirecting to check to see if that session variable exists (your thank you message) and if it does, display it. You could also do something like adding a GET parameter to the url of the page you're redirecting to, and then checking for that variable on the page and display a message the same way. JS: window.location.href="http://yoursite.com/?message=thank-you"; PHP on page getting redirected TO: if (isset($_GET['message']) AND $_GET['message'] == 'thank-you') { echo 'Thank you for creating your account'; } Personally I'd use sessions. Link to comment https://forums.phpfreaks.com/topic/293118-notification-script/#findComment-1499915 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.