PHP - How To Automaticly Put Url In Php Message
Hi2all!
I have one question: A have this page: http://proximabih.com/elitesecurity/test_mapa.html Its on my native lang, but what is important that at the bottom of page is generated google maps static image of dynamic map. Now - how to send, or how to integrate this image to php $body of ph contact form. My idea is to have two pages-first is above link, another is php contact form, so if we have php contact form, on first page maby i need to create SUBMIT button which will by code automaticly put url with poicture in contact form body. I really don have any idea, any help is very appriciate ) Similar TutorialsOk i have a question about a dynamic website.. What i have is a site that takes content from the MySQL database and load it into the index.php file. And i know how to change the content of the page when i move around in the navigation, e.g when i click on the "HOME" tab, the content for the home page is shown and when i click on "ABOUT", the information about my site is shown and so on.. Now for my question! I want the content too move everyday automaticly. For example, today i type in some content in the MySQL database that i want to be shown on my website for today. But tomorrow i want the content to have been moved to page 2, and the next day page 3 and so on.. So that everyday i can type in new content, and all the old pages get pushed back one page if that makes sense? Sorry but I have no actuall code for this cause i don't know how to start, but i guess you could use dates and "if else" statements to determine when the pages should be moved and not. Example code would be greatly appriciated! And when i say moved between pages, i mean like this: Today: www.mywebsite.com/index.php?pageid=1 - example 2 www.mywebsite.com/index.php?pageid=2 - example 1 www.mywebsite.com/index.php?pageid=3 - empty Tomorrow: www.mywebsite.com/index.php?pageid=1 - example 3 www.mywebsite.com/index.php?pageid=2 - example 2 www.mywebsite.com/index.php?pageid=3 - example 1 Hey all, Im currently working on a site which I save a cookie on users computer for 1 month as well a row in a table with the 1 month expiring date plus cookie id. What I would like to know is if theres a way to make the server check the table every day at say 12pm to see if any corresponding user cookies in each row have expired on that day as to remove them from the table to match the expiring cookie on the users computer? I would like not to have to rely on a user/admin accessing in to make a script run instead have something thats timed to go off automatically instead? Is there anyway of doing this? Thanks! right ive setup my own messaging feature on my website but it still allowes me to message myself if tried <? }else{ if($to == username){ ?> the whole code so you can get a better understanding <?php session_start(); include_once "includes/db_connect.php"; include_once "includes/functions.php"; logincheck(); $username=$_SESSION['username']; $fetch=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$username'")); if ($fetch->texts < '1'){ echo "<font color=red>You don't have No Texts Left</font><br>"; }elseif($fetch->texts >= '1'){ ?> <body onLoad="goaway();"><? $towho=$_GET['fromper']; $oldmsg=$_GET['oldmsg']; $text=$_POST['text']; $subject=$_POST['subject']; $fsubject=$_GET['fsubject']; $info=mysql_fetch_object(mysql_query("SELECT rank FROM users WHERE username='$username'")); $goody = mysql_query("SELECT `inbox`, `date`, `from` FROM `messages` WHERE `id`='$rep'"); while($success = mysql_fetch_row($goody)){ $ini = $success[0]; $dateon = $success[1]; $fromper = $success[2]; } if(strip_tags($_POST['Send'])){ $text=strip_tags(addslashes($text)); $to = strip_tags(addslashes($_POST['to'])); $rep = $_GET['rep']; if((!$to)){ ?> <p class="style4">Please enter a username!</p> <span class="style4"> <? }else{ if(!$text){?> </span> <p class="style4">You cannot send a blank message!</p> <span class="style4"> <? }else{ if($to == username){ ?> </span> <p class="style4">You cannot send a message to yourself!</p> <span class="style4"> <? }else{ $sql_username_check = mysql_query("SELECT username FROM users WHERE username='$to'"); $username_check = mysql_num_rows($sql_username_check); if ($username_check == 0){ ?> </span> <p class="style4">Invalid Username!</p> <span class="style4"> <? }else{ $date = gmdate('Y-m-d H:i:s'); $sql = mysql_query("INSERT INTO `inbox` (`id`, `to`, `from`, `message`, `date`, `read`, `subject`) VALUES ('', '$to', '$username', '$text', '$date', '0', '$subject');") or die (mysql_error()); $sqll = mysql_query("UPDATE users SET texts = texts-1 WHERE username='$username'"); if(!$sql){ ?> </span> <p class="style4">There has been an error please contact an Admin !</p> <span class="style1"> <? }else{ echo "<table width=300 border=1 align=center cellpadding=0 cellspacing=0 bordercolor=#003300 class=thinline2> <tr> <td height=20 align=center bgcolor=#74CE59 scope=col><span class=style1>Your Message As Been Sent </span></td> </tr> </table>"; }}}}}} ?> Hey Guys, I have followed a tutorial and got a SMS text message script working. Although what i would like to do now is allow a registered user to add another user via a form. This form will contain the users mobile number, email, who its from, and a textarea for the message to send to them in the text message. *** It also stores it into a database. But dont worry about that. I have run into a problem, when i type in a mobile number and an email address and then press send. It doesnt seem to store the email address in the $vars echo (message). **It does echo in the email bit but i wont it to show in the message bit. ** Here is a screenshot. Along the same lines as a "Thank you for you submission" message, is there a simple way to echo the CHANGES made to a record AFTER it has been UPDATED. For example: You have added 2 skirts and 1 shirt to your order OR You're order has been reduced by 2 pair of socks. This would compare what was stored with the change. Alternately, is there a way to show a message that ONLY addresses the values that have CHANGED as a result of the UPDATE. Example: You have altered the quantity of the following items: dresses, hats, gloves. hello, this is part of my contact form code. When i click on the submit button i need the form to take me to the $success_message or the $failure_message instead of the top of the page. I know i can do it with # tag or # id normally. But I do not know how to apply it to the form. Code: [Select] //some text and stuff<tr> <td> <? if(!empty($success_message)) { echo "<center><font color='blue'><b>".$success_message."</b></font><br></p>"; } if(!empty($failure_message)) { echo "<center><font color='red'><b>".$failure_message."</b></font><br></p>"; } ?> <? if((empty($_POST)) || !empty($strError)) { echo "<table align= 'center' width='70%' style='border-top: 1px; border-right: 1px; border-left: 1px; border-bottom: 1px; border-color: black; border-style: solid;'>"; ?> <form action="<?php echo $PHP_SELF;?>" method="post"> <tr height='40'> <td> <font color="black"><B> First Name: </B></font> </td> <td><input type="text" size ="40" name="first_name" value="<? if(!empty($strError)) {echo cleaninput($_POST['first_name']);}?>" class="advertising-inputbox-style" /> <?php if (!empty($arrErrors['first_name'])) echo $arrErrors['first_name']; ?> </td> </tr> <tr height='40'> <td><font color="black"><B> Last Name: </B></font></td> <td><input type="text" size ="40" name="last_name" value="<? if(!empty($strError)) { echo cleaninput($_POST['last_name']);}?>" class="advertising-inputbox-style"/> <?php if (!empty($arrErrors['last_name'])) echo $arrErrors['last_name']; ?> </td> </tr> <tr height='40'> <td><font color="black"><B> Email Address: </B></font></td> <td><input type="text" size ="40" name="email_address" value="<? if(!empty($strError)) { echo cleaninput($_POST['email_address']);}?>" class="advertising-inputbox-style"/> <?php if (!empty($arrErrors['email_address'])) echo $arrErrors['email_address']; ?> </td> </tr> <tr height='35'> <td><font color="black"><B> Business Name: </B></font></td> <td><input type="text" size ="40" name="business_name" value="<? if(!empty($strError)) { echo cleaninput($_POST['business_name']);}?>" class="advertising-inputbox-style" /> <?php if (!empty($arrErrors['business_name'])) echo $arrErrors['business_name']; ?> </td> </tr> <tr> <td><font color="black"><B> Business Description: </B></font></td> <td ><textarea rows=7 cols=31 name="description" class="advertising-textarea-style"><? if(!empty($strError)) { echo cleaninput($_POST['description']);}?></textarea> <?php if (!empty($arrErrors['description'])) echo $arrErrors['description']; ?> </td> <tr height='35'> <td></td> <td><input type="submit" name="submit" value="submit" /></td> </tr> </form> Code: [Select] <?php include 'header.php'; ?> <form name="form1" method="post" action="insert_ac.php"> <table id="formcss" width="100%" border="0" cellspacing="1" cellpadding="3" align="center"> <tr> <td colspan="3"><strong>Insert Data Into mySQL Database </strong></td> </tr> <tr> <td width="71">Name</td> <td width="6">:</td> <td width="301"><input name="name" type="text" id="name"></td> </tr> <tr> <td>Company</td> <td>:</td> <td><input name="company" type="text" id="company"></td> </tr> <tr> <td>Phone</td> <td>:</td> <td><input name="phone" type="text" id="phone"></td> </tr> <tr> <td>Mobile</td> <td>:</td> <td><input name="mobile" type="text" id="mobile"></td> </tr> <tr> <td>Email</td> <td>:</td> <td><input name="email" type="text" id="email"></td> </tr> <tr> <td>Called</td> <td>:</td> <td><input type="checkbox" name="call" value="training" /> Training <input type="checkbox" name="call" value="business" /> Business <input type="checkbox" name="call" value="legal" /> Legal <input type="checkbox" name="call" value="other" /> Other</td> </tr> </tr> <tr> <td>Patched To</td> <td>:</td> <td> <select name="patch"> <option value="sperkins">S.Perkins</option> <option value="srayson">S.Rayson</option> <option value="strandafil">S.Trandafil</option> <option value="tmoore">T.Moore</option> <option value="lharding">L.Harding</option> <option value="vmitchell">V.Mitchell</option> <option value="achilvers">A.Chilvers</option> <option value="aedwards">A.Edwards</option> <option value="rfrost">R.Frost</option> <option value="ohoogenhout">O.Hoogenhout</option> <option value="pkeily">P.Keily</option> </select> </td> </tr> <tr> <td>Filled out by</td> <td>:</td> <td><input name="user" type="text" id="user"></td> </tr> <tr> <td colspan="3" align="center"><input type="submit" name="Submit" value="Submit"></td> </tr> </table> </form> <?php include 'footer.php'; ?> Code: [Select] <?php $host="Localhost"; // Host name $username="root"; // Mysql username $password=""; // Mysql password $db_name="test"; // Database name $tbl_name="members"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // Get values from form $name=$_POST['name']; $company=$_POST['company']; $phone=$_POST['phone']; $mobile=$_POST['mobile']; $email=$_POST['email']; $call=$_POST['call']; $patch=$_POST['patch']; $user=$_POST['user']; // Insert data into mysql $sql="INSERT INTO $tbl_name(name, company, phone, mobile, email, call, patch, user)VALUES('$name', '$company', '$phone' '$mobile', '$email', '$call', '$patch', '$user')"; $result=mysql_query($sql); // if successfully insert data into database, displays message "Successful". if($result){ echo "Successful"; echo "<BR>"; echo "<a href='insert.php'>Back to main page</a>"; } else { echo "ERROR 1"; //This is where the error is. Not sure why it's not working } // close connection mysql_close(); ?> Can anyone see what i've done wrong here? I swear my brain is going to explode if i look over this one more time. Just a simple form trying to submit to the database Hi I would like to add a 'welcome message' (Hello John Doe, etc.) after successful login. Can this be done best in php? Cheers, visitor My code work and let me log in but whether the login is correct or not it keeps on displaying "Wrong username and password" if($count==1){ session_register("myusername"); session_register("mypassword"); header("location:login_success.php"); } else { echo "Wrong Username or Password"; } i am making a private messaging system like hotmails where the message list appears on the left. Then when you click on one of them the box on the right loads the email. The problem is i dont really know how to go about it. Anyone have any pointers? the script below works but i have started getting this error Quote Warning: Cannot modify header information - headers already sent by (output started at /hermes/bosweb/web230/b2302/ipg.myaccount/test_server/admin/index.php:10) in /hermes/bosweb/web230/b2302/ipg.myaccount/test_server/admin/index.php on line 95 line 95 is this bit header('Location: index.php'); <?php // Set Global Vars $HOST = "xxxxxxxxxx"; $USERNAME = "xxxxxxxxx"; $PASSWORD = "xxxxxxxxx"; $DATABASE = "group"; $TABLE = "Testimonials"; // Establish a connection mysql_connect($HOST, $USERNAME, $PASSWORD) or die(mysql_error()); mysql_select_db($DATABASE) or die(mysql_error()); //================================================================== // Check if anything is posted //================================================================== if (isset($_POST['delete'])) { $sql = ("delete from $TABLE where "); for ($i = 0; $i < count($_POST['checkbox']); $i++) { if ($i != 0) { $sql.= "OR "; } $sql .= " id='" . $_POST['checkbox'][$i] . "'"; //================================================================== // Select file to unlink based on id posted //================================================================== $sql_file_unlink = "select Download from $TABLE where id = {$_POST['checkbox'][$i]}"; $result_file_unlink = mysql_query($sql_file_unlink); $row_file_link = mysql_fetch_assoc($result_file_unlink); if($row_file_link) { unlink('../testimonial_files/' . $row_file_link['Download']); } //================================================================== } $result = mysql_query($sql); header('Location: index.php'); exit; } else { // select sql here $sql = "select * from `$TABLE` order by `id`;"; $result = mysql_query($sql); } ?> <table align="center" width="400" border="0" cellspacing="1" cellpadding="0"> <tr> <td colspan="6" align="center"><strong>Testimonials</strong> </td> </tr> <tr> <td><form name="delete" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>"> <table width="400" border="1" cellpadding="3" cellspacing="1"> <tr> <td align="center"><strong>Select</strong></td> <td align="center"><strong>ID</strong></td> <td align="center"><strong>Name</strong></td> <td align="center"><strong>Description</strong></td> <td align="center"><strong>Download</strong></td> <td align="center"><strong>Last Modified</strong></td> </tr> <?php $row = mysql_fetch_assoc($result); ?><?php do { ?> <tr> <td align="center"> <input name="checkbox[]" type="checkbox" id="checkbox[]" value="<?php echo $row['id']; ?>"> </td> <td align="center"><?php echo $row['id']; ?></td> <td align="center"><?php echo $row['Name']; ?></td> <td align="center"><?php echo $row['Message']; ?></td> <td align="center"><a href="../testimonial_files/<?php echo $row['Download']; ?>">Download</a></td> <td align="center"><?php echo date("j/n/y", strtotime($row["Modified"])) ?></td> </tr> <?php } while ($row = mysql_fetch_assoc($result)); ?> <tr> <td colspan="6" align="center"><input name="delete" type="submit" id="delete" value="Delete"></td> </tr> </table> </form> </td> </tr> </table> Let me know if i am understanding this correctly Below is the form code i put in my HTML editor followed by the php code that i right out as a text doc. then save as .php and upload to the appropriate location? if the above is correct what do i name the php file scripts/send_sms.php? when i do it this way i get this error message Not Found The requested URL /scripts/sms_error.php was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. Code: [Select] <?php $from = $_POST['from']; $to = $_POST['to']; $carrier = $_POST['carrier']; $message = stripslashes($_POST['message']); if ((empty($from)) || (empty($to)) || (empty($message))) { header ("Location: sms_error.php"); } else if ($carrier == "verizon") { $formatted_number = $to."@vtext.com"; mail("$formatted_number", "SMS", "$message"); // Currently, the subject is set to "SMS". Feel free to change this. header ("Location: sms_success.php"); } else if ($carrier == "tmobile") { $formatted_number = $to."@tomomail.net"; mail("$formatted_number", "SMS", "$message"); header ("Location: sms_success.php"); } else if ($carrier == "sprint") { $formatted_number = $to."@messaging.sprintpcs.com"; mail("$formatted_number", "SMS", "$message"); header ("Location: sms_success.php"); } else if ($carrier == "att") { $formatted_number = $to."@txt.att.net"; mail("$formatted_number", "SMS", "$message"); header ("Location: sms_success.php"); } else if ($carrier == "virgin") { $formatted_number = $to."@vmobl.com"; mail("$formatted_number", "SMS", "$message"); header ("Location: sms_success.php"); } ?> Code: [Select] <form id="sms" name="sms" method="post" action="scripts/send_sms.php"> <table width="400"> <tr> <td align="right" valign="top">From:</td> <td align="left"><input name="from" type="text" id="from" size="30" /></td> </tr> <tr> <td align="right" valign="top">To:</td> <td align="left"><input name="to" type="text" id="to" size="30" /></td> </tr> <tr> <td align="right" valign="top">Carrier:</td> <td align="left"><select name="carrier" id="carrier"> <option value="verizon">Verizon</option> <option value="tmobile">T-Mobile</option> <option value="sprint">Sprint</option> <option value="att">AT&T</option> <option value="virgin">Virgin Mobile</option> </select></td> </tr> <tr> <td align="right" valign="top">Message:</td> <td align="left"><textarea name="message" cols="40" rows="5" id="message"></textarea></td> </tr> <tr> <td colspan="2" align="right"><input type="submit" name="Submit" value="Submit" /></td> </tr> </table> </form> why am I getting You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '7'' at line 1: Code: [Select] <?php session_start(); // Must start session first thing /* Created By Adam Khoury @ www.flashbuilding.com -----------------------June 20, 2008----------------------- */ // Here we run a login check if (!isset($_SESSION['id'])) { echo 'Please <a href="login.php">log in</a> to access your account'; exit(); } //Connect to the database through our include include_once "connect_to_mysql.php"; // Place Session variable 'id' into local variable $id=$_SESSION['id']; // Process the form if it is submitted if ($_POST['startdate']) { $event = $_POST['event']; $startdate = $_POST['startdate']; $enddate = $_POST['enddate']; $description = $_POST['description']; $subevent1 = $row['subevent1']; $subevent2 = $row['subevent2']; $subevent3 = $row['subevent3']; $subevent4 = $row['subevent4']; $subevent5 = $row['subevent5']; $subevent6 = $row['subevent6']; $subevent7 = $row['subevent7']; $subevent8 = $row['subevent8']; $title1 = $row['title1']; $title2 = $row['title2']; $title3 = $row['title3']; $title4 = $row['title4']; $title5 = $row['title5']; $title6 = $row['title6']; $title7 = $row['title7']; $title8 = $row['title8']; $price1 = $row['price1']; $price2 = $row['price2']; $price3 = $row['price3']; $price4 = $row['price4']; $price5 = $row['price5']; $price6 = $row['price6']; $price7 = $row['price7']; $price8 = $row['price8']; $sql = mysql_query("UPDATE Registration SET event='$event', startdate='$startdate', enddate='$enddate', description='$description', subevent1='$subevent1', subevent2='$subevent2', subevent3='$subevent3', subevent4=$subevent4', subevent5='$subevent5', subevent6='$subevent6', subevent7='$subevent7', subevent8='$subevent8', title1='$title1', title2='$title2', title3='$title3', title4='$title4', title5='$title5', title6='$title6', title7='$title7', title8='$title8', price1='$price1', price2='$price2', price3='$price3', price4='$price4', price5='$price5', price6='$price6', price7='$price7', price8='$price8', id='$id'") or die (mysql_error()); printf("Records updated: %d\n", mysql_affected_rows()); exit(); } // close if post ?> im trying to get new user messages to show up on my site.. i have looked around on google but can only find info on popup alerts.. i just need a simple javscript code that will display the number of new messages next to the link that takes them to their inbox.. if someone could point me to a site or if they have the code handy i would appreciate it more than you know.. thank you I have this php code to load a word document : sample.docx
//define a variable define('wdPropertyTitle', 1);
//instantiate the object OK
// check Class //check the object
echo "<pre>";
?> Question: When I run the script, I get the following exception: PHP Fatal error: Uncaught com_exception: <b>Source:</b> Microsoft Word<br/><b>Description:</b> This command is not available because no document is open. in C:\phpFolder\php_codes\class_COM.php:75 Stack trace: #0 {main} thrown in C:\phpFolder\php_codes\class_COM.php on line 75 Do you have any solution to get this thing done?, please PS: I have : win 10, php 7.4.1, IIS 10 , php_com_dotnet is active in php.ini, Dcom Configured in windows snap-in Appreciated Mohamad Aflatooni The following piece of POST header details to output to a file in JSON format returns the following error:
[/code]$params = array("user" => $enjin_id); $query = http_build_query($params); $contextData = array("method" => "POST", "header" => "Connection: close\r\n" . "Content-Length: " . strlen($query)."\r\n", "content" => $query ); $context = stream_context_create(array ( "http" => $contextData )); $result = file_get_contents($url, FALSE, $context);[/code] error: file_get_contents(): Content-type not specified assuming application/x-www-form-urlencodedCan anyone advise what I need to do to ensure that the process is correctly set, of which I assume I need to declare a MIME type and where it is needed? i am making a message system which users can message each other. sending message works fine but having trouble with the reply message cant seem to get to_user value code so far Code: [Select] <?php session_start(); $myusername=$_SESSION['myusername']; require "database.php"; $messageid = $_GET['messageid']; $message = mysql_query("SELECT * FROM messages WHERE message_id = '$messageid' AND to_user = '$myusername'"); $message=mysql_fetch_assoc($message); // problem is here atm getuname returns Resource id instead of the username iam trying to reply to // $getuname= mysql_query("SELECT from_user FROM messages Where message_id='$message_id' AND to_user ='$myusername'"); echo "<h1>Title: ".$message['message_title']."</h1><br><br>"; echo "<h3>From: ".$message['from_user']."<br><br></h3>"; echo "<h3>Message: <br>".$message['message_contents']."<br></h3>"; echo '<form name="backfrm" method="post" action="inbox.php">'; echo '<input type="submit" value="Back to Inbox">'; // this where i need to the to user to carry over to the next page// echo '<a href="reply.php?username=' . "$getuname" . '">reply</a>'."<br/>"; echo '</form>'; ?> </body> </html> We are not getting the error message, that should match with the error_code
We sending the code and the object contains the error/success message to show!!!
This seems to almost works. It is part of Jquery Validations, once the field or submit button is clicked. It looks for error on field. then Enter the Ajax Funciton which is to parse the error code and the out put the error message which is coming from json object.
The code is not returning the error message, on line (alert(data))
Produces [object,object] not actual data string.
The error message does not return. Please help, is there something work with our ajax request
//*new style for error Messages*/ //var jsonErrors = frontEndErrorCodes; //JC wrote. //MG added. To retrieve Front-end error codes as well as //Backend Error Codes function _getErrorMessage(errorCode, message){ var errorData = JSON.stringify({error_code: errorCode, message: message}); var dataString = $.parseJSON(errorData); $.ajax({ url: './retrieveErrorMessage.json', type: 'POST', data: dataString, dataType: "json", contentType: 'application/json', mimeType: 'application/json', success: function(data) { //data = $.parseJSON(data); alert(data); $('.error.message').contents().find('h4').text(data.message); // if(!vanillaeGift.notify.called) { // $('.error.message').contents().find('h4').text(error.text()); // vanillaeGift.notify.showNotification(".error"); // } //Bolt Notification Called and Enabled here if(BoltNotify == true){ var spanerrorgen = $('.error.message').contents().find('h4').html(data.message); VanillaReload.notify.showNotification(".error"); }else if(BoltNotify == true && multipleNotice ==true ){ var spanerrorgen = $('.error.message').contents().find('h4').html(data.message); VanillaReload.notify.showNotification(".error").append(spanerrorgen); }else{ var spanerrorgen = $("<span/>").css("color","#D00").hide().addClass("error").html(data.message); $fieldref.parent().append(spanerrorgen) spanerrorgen.show("fast"); } }, error: function(data) { //data = $.parseJSON(data); alert(data); $('.error.message').contents().find('h4').text(data.message); // if(!vanillaeGift.notify.called) { // $('.error.message').contents().find('h4').text(error.text()); // vanillaeGift.notify.showNotification(".error"); // } //Bolt Notification Called and Enabled here if(BoltNotify == true){ var spanerrorgen = $('.error.message').contents().find('h4').html(data.message); VanillaReload.notify.showNotification(".error"); }else if(BoltNotify == true && multipleNotice == true ){ var spanerrorgen = $('.error.message').contents().find('h4').html(data.message); VanillaReload.notify.showNotification(".error").append(spanerrorgen); }else{ var spanerrorgen = $("<span/>").css("color","#D00").hide().addClass("error").html(data.message); $fieldref.parent().append(spanerrorgen) spanerrorgen.show("fast"); } }, fail: function(jqXHR, textStatus) { alert(data); if(textStatus == "parsererror"){ return "We're Sorry a system error occured"; } } }); } Can anyone help me with this delete confirm box. I have tried but somehow its not working. Can anyone help me with this? Thankz. html codes : echo "<td><a href=delete.php?id=" . $rows['id'] ." onclick=\"return confirm(Are you sure?);\">Delete</a></td>"; delete.php : <?php include "config.php"; ?> <?php $id=$_GET['id']; ?> <script type="text/javascript"> <!-- function confirmation() { var answer = confirm('Are you sure you want to delete?') if (answer){ $sql="DELETE FROM document WHERE id='$id'"; } else{ alert("Cancelled the delete!") } } </script> |