lxndr Posted December 21, 2008 Share Posted December 21, 2008 I'm not sure if this is the best place to ask this question as it all depends on what the answer is. Basically, I need to modify an existing php program with reads in a file of messages and if there's a message for the user who's running the program it generates a javascript alert with the message displayed in it. What I need to be able to do is provide the means of replying to the alert. I could do away with the alert altogether of course but I need something that sits on top of the screen in all browsers that can only be got rid off by clicking OK (or by replying). I'm simply not sure of the best way to go about this and would welcome any positive suggestions or help. TIA.. Link to comment https://forums.phpfreaks.com/topic/137875-replying-to-an-alert-sort-of/ Share on other sites More sharing options...
hellonoko Posted December 21, 2008 Share Posted December 21, 2008 What about a javascript popup window instead of a alert. You could use focus() to bring it to the front so they see it? Then you can have whatever page inside the popup with options for the user to click. Link to comment https://forums.phpfreaks.com/topic/137875-replying-to-an-alert-sort-of/#findComment-720577 Share on other sites More sharing options...
lxndr Posted December 21, 2008 Author Share Posted December 21, 2008 What about a javascript popup window instead of a alert. You could use focus() to bring it to the front so they see it? Then you can have whatever page inside the popup with options for the user to click. Do you know if that will that work cross-browser consistently including Opera and Safari ? __ Link to comment https://forums.phpfreaks.com/topic/137875-replying-to-an-alert-sort-of/#findComment-720579 Share on other sites More sharing options...
Andy-H Posted December 21, 2008 Share Posted December 21, 2008 No, javascript can be disabled by the user and therefor isn't consistant in any browser. Use something like PHP and make a little class or function to display it at the top of the page each time it loads, then when they do whatever update the status. Link to comment https://forums.phpfreaks.com/topic/137875-replying-to-an-alert-sort-of/#findComment-720580 Share on other sites More sharing options...
redarrow Posted December 21, 2008 Share Posted December 21, 2008 php example quick one. <?php // display message if field is empty if (empty($username)) { $error="Please enter a username.<br><br> <a href='whatever.com/start_agin.php'>Try agin</s>"; echo $error; exit; } if (empty($password)) { $error= "Please enter a password.<br><br> <a href='whatever.com/start_agin.php'>Try agin</s>"; echo $error; exit; } if (empty($email)) { $error= "Please enter a valid email<br><br> <a href='whatever.com/start_agin.php'>Try agin</s>"; echo $error; exit; } ?> Link to comment https://forums.phpfreaks.com/topic/137875-replying-to-an-alert-sort-of/#findComment-720642 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.