In php, how does one implement a dialog box with two buttons? After querying the database, a dialog box pops up based on the query results to select whether to continue uploading data and overwrite the original data. OK and Cancel buttons? I can only implement one button now.
Reply to discussion (solution)
ToAdd a name attribute
Based on isset ($ _ POST ['submit _ button_name ']) in the background, you can determine which button to press
ToAdd a name attribute
Based on isset ($ _ POST ['submit _ button_name ']) in the background, you can determine which button to press
What you saidIs it implemented in the form? My upload. php is a form. The form action is transferred to upinfo. php. in upinfo. php,
If ($ row) // $ row is the query result {echo "script" alert ('The Upload will overwrite the original file. Are you sure you want to upload the file? '); Script "; // There is only one OK button. how do I want two buttons ?............} Else {............}
...
Of course, alert only has one button.
Confirm has two buttons
Echo "script" if (confirm ('The Upload will overwrite the original file. Are you sure you want to upload the file? ') {...}; Script ";
I am not very clear about the meaning of the landlord. can I post some code?
If ($ row) // $ row is the query result {echo "script confirm ('this Upload will overwrite the original file. Are you sure you want to upload the file? '); Script "; // There is only one OK button. how do I want two buttons ?............} Else {............}
Echo "script" if (confirm ('The Upload will overwrite the original file. Are you sure you want to upload the file? ') {...}; Script ";
Thank you very much. In fact, I also know that there is a dialog box like confirm, but it will not be used flexibly. the root cause may be that the foundation is poor. thank you very much.