Jump to content

Message Box


fallenangel1983

Recommended Posts

Hey all,

 

I have a button on a page and its purpose is to delete a ecord form a table.

 

Is there a way to have a essage box flash up saying...

 

are you sure you wish to delete?

 

and two options stating ok or cancel.

 

if ok is pressed then delete the record . if cancel is pressed do not delete just return to previous pge.

 

i have looked through the tutorials and an find nothing that relates to this. can you help.

 

cheers.

Link to comment
Share on other sites

Here a php aproach, not all users have javascript turn on be carefull.........

 

Try it for fun.....

 

<?php session_start();

$_SESSION['name']="redarrow";

if($_POST['submit']){

if($_GET['cmd']=="delete"){

echo" PLEASE BE ADVISED DELETING ALL DATA PLEASE CONFIRM! <p></p>";


$self=$_SERVER['PHP_SELF'];

echo"
<form method='POST' action='$self?cmd=yes'>
<input type='text' value='".$_SESSION['name']."'>
<input type='submit' name='submit' value='CONFIRM DELETE'>
</form>";
exit;
}

if($_GET['cmd']=="yes"){

unset($_SESSION['name']);

echo" USERNAME DELETED! ".$_SESSION['name']." ";
exit;
}
}

$self=$_SERVER['PHP_SELF'];

echo"
<form method='POST' action='$self?cmd=delete'>
<input type='text' value='".$_SESSION['name']."'>
<input type='submit' name='submit' value='DELETE DATA'>
</form>";

?>

Link to comment
Share on other sites

Remember javascript/ajax is client side not server side hence script lanauage not

a programming lanuage........

 

Now let say 100 hits to my web site, let say only 1

out off 10 got javascript off, out off 100 people

that 10 people but guess what them 10 people wanted

to buy 10 exspensive items

i lost money havent i !

 

DO NOT RELY ON JAVASCRIPT!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.