PHP Confirm Prompt?

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!

Moderator: General Moderators

Post Reply
drgnjucr
Forum Commoner
Posts: 30
Joined: Thu Jan 27, 2005 3:06 pm
Location: NJ
Contact:

PHP Confirm Prompt?

Post 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?
calcop
Forum Newbie
Posts: 20
Joined: Fri Mar 04, 2005 2:13 pm

Post by calcop »

Is this for a command prompt application?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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 :)
drgnjucr
Forum Commoner
Posts: 30
Joined: Thu Jan 27, 2005 3:06 pm
Location: NJ
Contact:

Post 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!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

here's a hint:

form.php :arrow: delete.php?p=685 :arrow: delete.php?p=685&confirm=1
Phoenixheart
Forum Contributor
Posts: 123
Joined: Tue Nov 16, 2004 7:46 am
Contact:

Post by Phoenixheart »

I prefer scripting a javascript funtion like this

Code: Select all

if(confirm("Do you want to delete?")) //do delete
:D
User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Post by Bill H »

I prefer scripting a javascript funtion like this
And if the viewer has his browser set to disable javascript?
Phoenixheart
Forum Contributor
Posts: 123
Joined: Tue Nov 16, 2004 7:46 am
Contact:

Post 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!"
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

...and that's a surprise? I guess so.. :?
Post Reply