Hello friends! I want the script when user clicks the Delete botton to delete that post, a confirm message appears and ask if the user is sure to delete that post or not, if the user clicks the cancel button, nothing happen but if clicks the ok button, then the script delete that post. this is the main code: <?php include('connection.php'); try { $sql = "SELECT ID, Title, Author, Content FROM Posts"; $result = $conn->query($sql); echo "<h4>LOGGED IN AS: " . $_SESSION["Username"] . "</h4>"; echo "<p id='err_msg'></p>"; echo "<table cellspacing='0' cellpadding='20' border='1px solid black' border-collapse='collapse'>"; echo "<tr><th> POST ID </th><th> …

Member Avatar
Member Avatar
+0 forum 2

Hi guys, so i have a table populated by event details from database and i use a checkbox to select which event to be deleted: echo "<tr> <td><input type='checkbox' name='check[]' class='check' value='$id'>$name</a></td><td>$formatDate</td> </tr>"; my delete function: <?php if(isset($_SESSION['sess_user_id'])) { if(isset($_POST['del_event']) && isset($_POST['check'])) { require "connection.php"; $userid = $_SESSION['sess_user_id']; foreach($_POST['check'] as $del_id) { $del_id = (int)$del_id; $sqlqueer = "DELETE FROM event WHERE event_id IN ($del_id) AND euser_id IN ($userid)"; $deletion = $dbh->query($sqlqueer); if($deletion) { echo "<script type='text/javascript'>window.location.href='event.php';</script>"; } } } } ?> and it works fine. I wanna know how to call that delete function after a confirm dialog, something like …

Member Avatar
Member Avatar
+0 forum 15

hi guys, i just want to create a javascript confirm script if the file will overwrite the current file with the same filename or with a file already existing. if yes: ask to overwrite if no: back to edit file page function overwrite() { var r=confirm("The same file name existing. Overwrite File?") if (r==true) { document.write("<?php // is this possible? ?>"); alert("overwrite done"); } else { alert("You pressed Cancel!") } } </script> $target = "files/"; $target = $target . basename($_FILES['upfile']['name']); $vbasename = basename($_FILES['upfile']['name']); if (empty($vbasename)) { $query = "UPDATE tablefile SET fld_title = '{$file_title}', fld_tags = '{$content}', fld_user = '{$vuser}', …

Member Avatar
Member Avatar
+0 forum 40

Hi guys, I have a simple php script to upload file. I'm having some problem in creating confirmation before overwriting the file from new file upload. Situation: 1. confirm() works if using file_exists BUT not overwrite the file or process the move_uploaded_file assuming some tags are correct uploadfile.php <form enctype="multipart/form-data" action="addfile.php" method="POST" action="javascript:alert('success!');"> <td><label for="file">Choose File to Upload:</label></td> <td> <input type="file" name="upfile" id="upfile"> <br><br> <input type="hidden" name="MAX_FILE_SIZE" value="1000000" /> <input type="hidden" name="fileuploaded"> </td> </tr> <tr> <td></td> <td> <input type="submit" name="submit" value="Add" class="pure-button pure-button-success" onclick="tellme();"> <!-- <input type="submit" name="submit" value="Add" class="confirmLink"> --> <a href="index.php" ><button class="pure-button pure-button-secondary">Cancel</button></a> </form> addfile.php <script type="text/javascript"> …

Member Avatar
Member Avatar
+0 forum 5

I'm sure this has been asked before but can't seem to find it. I've a (mostly) php page which has a simple button on it to print. Printing is done with a simple onClick="print.window()". Everything's fine in that it's calling the print.css correctly and what is being printed is what I expect. I'd like to have a method for asking the user if the document printed OK. If they say yes, I'll send them to a page that purges the php session and logs them out. If no, we'll either remain on or redisplay the page they tried to print. …

Member Avatar
Member Avatar
+0 forum 8

Please help I've written this code and it works until i asked it to check if the radio buttons were checked and if none of them were checked to come up with an error alert and if one of them was checked to ask the user to confirm if it was the level they wanted. Please help!! <head> <title>Exam entry</title> <script language="javascript" type="text/javascript"> var level; result = true; msg=""; function validateForm() { var result = true; msg=""; if (document.ExamEntry.name.value=="") { msg+="You must enter your name \n"; document.ExamEntry.name.focus(); document.getElementById('name').style.color="red"; result = false; } if (document.ExamEntry.subject.value=="") { msg+="You must enter the subject …

Member Avatar
Member Avatar
+0 forum 3

It's now official, account passwords for the popular business social network LinkedIn have been compromised. Vicente Silveira, a director at LinkedIn, has confirmed that some of the passwords that were published online by a Russian hacking group "correspond to LinkedIn accounts". How many of the 161 million LinkedIn members have been impacted by this breach is as yet unknown, however it is likely to be a relatively small percentage as the published list of passwords is 'only' 6.5 million in number, even if LinkedIn passwords prove to be the vast majority if not all of them. ![dweb-leakedin](/attachments/small/0/dweb-leakedin.jpg "align-right") The list …

Member Avatar
Member Avatar
+0 forum 18

I want pop out a confirm message box like Response.Write("<Script>confirm('Are you sure???');</Script>"); But I want control if Ok then do wat else do wat.

Member Avatar
Member Avatar
+0 forum 1

HI EVERY ONE how i can insert a confirm dialog box behind delete record button so that it will prompt like this ARE YOU SURE YOU WANT TO DELETE? YES OR NO ? if yes button is pressed then it will delete other wise dont .? thanks in advance

Member Avatar
Member Avatar
+0 forum 3

Hello, this one is probably really simple, but I am a noob... I just want the password confirmation function to work and I would also like the password to not equal the username. I am running into a problem with how I set up the logic for my variables. Trying to fix my registration and login page. All the other logic statements work just fine. Thank you. [CODE]<?php class Register { private $username; private $password; private $confirm_password; private $passmd5; private $email; private $errors; private $token; public function __construct() { $this->errors = array(); $this->username = $this->filter($_POST['ruser']); $this->password = $this->filter($_POST['rpass']); $this->confirm_password = …

Member Avatar
Member Avatar
+0 forum 6

Hi there, I have a question related to this topic, i dont know if I should make a new thread or how to make a new thread. I am making an adult website and I just need a disclaimer and 2 buttons one that verifies age or one that redirects them out of the site. Here is the code someone told me I would have to use [CODE]if (cookie doesn't exist) { print agreement if (agreed) { make cookie redirect } } else { print real page }[/CODE] I was hoping someone could make this in php for me, cause …

Member Avatar
Member Avatar
+0 forum 5

Basically I have a database and a form set up that enters information into the mysql database using php code. This works perfectly. The problem I'm having is writing a php sequence to send an email that confirms the user wanted to post the information. I would also like the data to not be posted on my site ( I have a separate php code that gets the data from the database on another page) until they have confirmed, using the email, that they in fact wanted to post. Any help would be greatly appreciated. I just started web development …

Member Avatar
Member Avatar
+0 forum 1

Hi, I'm trying to confirm a Delete action that will remove data from a database. The code is pure php, no jscript etc as I want everything to be server side. My php file shows a form with the current data found for a venue with 1 or more 'rooms' in it. There are two dB tables, one for venues, one for rooms. The form has submit buttons to reload the form and I then evaluate the $_POST data to take the relevant action ppprior to echoing the HTML page code out. One possible action is to add a new …

Member Avatar
Member Avatar
+0 forum 3

The End.