PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am having a hard time figuring out how to use this piece of Javascript to return the value to a php variable. The following code will create an OK / Cancel message box in javascript. However, I would like to return which was chosen to a php variable. I know this can be done, I'm just not sure how.
It needs to be something like <script><?php $answer = ?> confirm(\"Delete?\");</script> but within an echo statement too!
Can someone help please?
echo "<script>confirm(\"Are you sure you want to delete?\");</script>";//creates message box
//It needs to be something like
echo " ?><script><?php echo '$answer =' ?> confirm(\'Are you sure you want to delete?\');</script> <?php echo ";?> but within an echo statement too!
I have a javascript confirm box that pops up asking if the user wants to Delete. The user can answer OK or cancel. I need the response returned to a php variable. I know php is server side, but how can such be possible to prompt the user for an answer with a msg box in php?