I am new to PHP. I have to display a message box asking if new record is required or we can copy and modify an old record to the user while adding a new record. How can I do this? Please help.
Asked
Active
Viewed 1.1k times
2
-
1What did you try so far? Messageboxes are usually in JavaScript – toesslab Jun 03 '14 at 07:48
-
PHP is a server framework, are you looking for a javascript function to display to your users in the browser? (it's called confirm() ) – Anders Bornholm Jun 03 '14 at 07:49
-
I tried using modal forms and javascript but not able to get the result. – user3678823 Jun 03 '14 at 07:49
-
yes Anders Bornholm, have to display this to the user and get the option. – user3678823 Jun 03 '14 at 07:51
-
1post the code you have used so far.Then only we can help you – Vaisakh Pc Jun 03 '14 at 07:51
-
1I have to say that PHP _is not_ a framework. You can use pure javascript or some frontend javascript framework (like jquery-ui) to do it – kosmos Jun 03 '14 at 07:52
1 Answers
3
I usually use this for messageboxes:
function alert($string)
{
echo '<script type="text/javascript">alert("' . $string . '");</script>';
}
Not the cleanest method, but usually works without problems.

Realitätsverlust
- 3,941
- 2
- 22
- 46