Page 1 of 1
PHP Confirm Prompt?
Posted: Fri Mar 04, 2005 1:46 pm
by drgnjucr
I know confirm boxes are a "client side" action, but I'm looking for a way to echo a confirmation prior to updating or deleting a record?
Basically, it's an if statment, where I can to have conditions which require user input.
Anyone know how I can acomplish this?
Posted: Fri Mar 04, 2005 2:25 pm
by calcop
Is this for a command prompt application?
Posted: Fri Mar 04, 2005 2:53 pm
by feyd
output html for this box, with the necessary information stored in a form or similar that will "confirm" the submission.. hopefully it isn't large data

Posted: Fri Mar 04, 2005 3:10 pm
by drgnjucr
I output HTML when a condition is true.
I have a form, say: form.php whichs posts to a process.php
In process php, I take a condition and prompt with html, "do you want to delete this record?"
But I'm not sure how to take that input and continue with my function to execute an SQL statement.
I hope that makes sense. I think I'm confusing myself!
Posted: Fri Mar 04, 2005 3:23 pm
by feyd
here's a hint:
form.php

delete.php?p=685

delete.php?p=685&confirm=1
Posted: Tue Mar 08, 2005 7:22 am
by Phoenixheart
I prefer scripting a javascript funtion like this
Code: Select all
if(confirm("Do you want to delete?")) //do delete

Posted: Tue Mar 08, 2005 9:23 am
by Bill H
I prefer scripting a javascript funtion like this
And if the viewer has his browser set to disable javascript?
Posted: Mon Apr 18, 2005 5:43 am
by Phoenixheart
Man, Google Mail (Gmail) is using javascript for their service, and if you disable js, it will yell "Please enable JavaScript or our site won't work!"
Posted: Mon Apr 18, 2005 7:26 am
by feyd
...and that's a surprise? I guess so..
