PHP - Help With This Small Question
I have a search button to help user searching text they are looking.
and i use $_GET to pass the value and get it into my query so it simply like this when value was passed into the URL page.php?search=text the problem is that when i try to modify a bit like this page.php?search=">test although i don't get any problem with the query (ERROR) as i've replaced all special characters with blank string, but i always have this test" /> text appear on my page.. what should i do to avoid this?? if they can do whatever they want, it means there is a space for attacker to inject bad codes thanks in advance Similar Tutorialslet say i have this <a href="myuploadfolder/picture1.jpg">Picture</a> and when user click on the link, they can see in which folder their picture were kept...is this dangerous?? if yes then how to hide it?? thanks in advance Hey guys. Sorry to start asking questions being such a new member but this just suddenly came up. I have a php script that needs to send binary data to another php script via HTTP. The data can be transferred through the methods GET and POST, preferably POST and preferably not as a file. The problem is that I have tried a number of ways to do this but every time the data seems to be corrupted. Some bytes stay the same but others disappear or change. I guess that they transfer through ASCII mode instead of BINARY but couldn't find any way to fix this. Any help would be deeply appreciated. Cheers. Hi all, I thought instead of just simple do all the security stuff automatically, why not see for myself what the it can do. So I made a simple table besides the other tables named delete_me, made a form and started testing. But for some reason I can get that table to drop. this is what i did on the front end with help from he http://en.wikipedia.org/wiki/SQL_injection in all 3 fields (firstname, lastname email) put a value and in the last one i put: but nothing happend. if someone knows what i am doing wrong please tell me because I think it's vital in order to protect yourself one needs to know what he or she is up against. Hi all a small question. I was wondering if someone knows what would be the approach to achieve the following. on a page I show a random number. If the page refreshes (selfreferencing) It shows a new random number but also a the previous number, and this must be able to repeat itself : ) So to make it more visible: New Random number = 98765 Previous Number = 56412 This is what I have but it's ofc not working because ones the session var has been set it will not show the previous variable but the very first one. <?php session_start(); $random_number .= mt_rand(1,100000); if(!isset($_SESSION['number'])){ $_SESSION['number']=$random_number; } // echo all out: echo 'New random number is: '.$random_number; echo 'Previous number is: '.$_SESSION['number']; ?> I bet i need another variable to store the previous one in but for some reasons my brains don't work at the moment Hi all, I just stumbled upon the 'new' filter function of php and i was wondering if someone could maybe recommend me which to use. for instance if i have a script: <?php $_evilstring = "<script> alert('justin bieber is ruining your sound system')</script>"; $_clean1 = htmlspecialchars($_evilstring); echo 'clean string one = '.$_clean1.'<br />'; $_clean2 = filter_var($_evilstring, FILTER_SANITIZE_SPECIAL_CHARS); echo 'clean string two = '.$_clean2.'<br />'; ?> Both output exactly the same. Now i was wondering if there might be differences in them. For some reason I would like to use the filter function because the name sounds better, but that of course is not very scientific. Anyone with ideas maybe performance, speed, wickedness?? HI all, I have a book with some nice examples, but often i wonder if they are that secure for displaying and using outside the production area. One of them is this. A form is created by using a while loop that gets data(email addresses) from a database and shows them with check boxes. after that someone can select the e-mailaddress they don't like and delete them from the database. here is some code: <?php //.... $result = mysqli_query($dbc,$query); while ($row = mysqli_fetch_array($result)){ echo '<input type="checkbox" value"'.$row['id'].'"name="todelete[]"/>'; echo $row['firstname']; } //.........deleting part if (isset($_POST['submit'])){ foreach($_POST['todelete'] as $delete_id){ $query = "DELETE FROM email_list WHERE ID = $delete_id"; mysqli_query ($dbc, $query) or die ('error querying databse'); } } //.... ?> I have two questions: -> is this a smart way of deleting stuff? since you are going to use multiple queries instead of 1 in the for each loop. -> besides not using mysqli_real_escape_string, isn't this application allowing someone to alter the POST-array (todelete) to any value he likes? At least that's what i think can happen. If anyone knows a nice way to do this more secure , I would love to here it, because i don't really trust the html array created. Thanks in advance! Hey guys i have a contact form for my site working fine but when i receive the emails i get some unwanted texts after the email section. here they r : name1: ryan number: 343244 message1: hey email: ss@yahoo.com clearField: [type Function] label1: NAME label2: E-MAIL label3: PHONE label5: MESSAGE countField: 5 arrayLabel: undefined,NAME,E-MAIL,PHONE,undefined,MESSAGE i: 6 txtField: _level0.topmenu.page.pages.contactform.txtField5 _request: contact/email.php the script Code: [Select] <?php /***************************************************\ * PHP 4.1.0+ version of email script. For more * information on the mail() function for PHP, see * http://www.php.net/manual/en/function.mail.php \***************************************************/ // First, set up some variables to serve you in // getting an email. This includes the email this is // sent to (yours) and what the subject of this email // should be. It's a good idea to choose your own // subject instead of allowing the user to. This will // help prevent spam filters from snatching this email // out from under your nose when something unusual is put. $sendTo = "hey@email.com"; $subject = "helloy"; // variables are sent to this PHP page through // the POST method. $_POST is a global associative array // of variables passed through this method. From that, we // can get the values sent to this page from Flash and // assign them to appropriate variables which can be used // in the PHP mail() function. // header information not including sendTo and Subject // these all go in one variable. First, include From: $headers = "From: " . $_POST["firstName"] ." ". $_POST["lastname"] . "<" . $_POST["email"] .">\r\n"; // next include a replyto $headers .= "Reply-To: " . $_POST["email"] . "\r\n"; // often email servers won't allow emails to be sent to // domains other than their own. The return path here will // often lift that restriction so, for instance, you could send // email to a hotmail account. (hosting provider settings may vary) // technically bounced email is supposed to go to the return-path email $headers .= "Return-path: " . $_POST["email"]; // now we can add the content of the message to a body variable $message = $_POST['message']; $message = ""; foreach($_POST as $key=>$value) { $message .= $key.": ".$value."\n\r"; } // once the variables have been defined, they can be included // in the mail function call which will send you an email mail($sendTo, $subject, $message, $headers); ?> can some1 suggest me something iam a complete noob ! I'm trying to find the write coding to pull the First and Second words from the 2nd line and the entire 3rd line from this file and have them as $subject1 and $subject2 And I have no php background. http://www.weatherserver.net/text/CWTO/WOCN11.txt so $subject1 = WOCN11 CWTO and $subject2 = SPECIAL WEATHER STATEMENT i am using a php mail scriot which is perfectly sending emails... Code: [Select] <?php require("class.phpmailer.php"); // path to the PHPMailer class $to=$_POST['email']; $msg='<html> <body><h1>My HTML Message</h1> <p>This is text</p> </body> </html>'; $sub=$_POST['sub']; $mail = new PHPMailer(); $mail->IsSMTP(); // telling the class to use SMTP $mail->Mailer = "smtp"; $mail->Host = "mail.mydomain.com"; //$mail->Port = 587; $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Username = "user@mydomain.com"; // SMTP username $mail->Password = "password"; // SMTP password $file = './abc.txt'; // attachment $mail->addAttachment('./attachment.jpeg'); $mail->From = "USER"; $mail->AddAddress("$to"); $mail->Subject = "$sub"; $mail->Body = "$msg"; $mail->WordWrap = 50; if(!$mail->Send()) { echo 'Message was not sent.'; echo 'Mailer error: ' . $mail->ErrorInfo; } else { echo 'Message has been sent.'; } } ?> Every thing is working fine.. But when i paste any html thing in the $msg variable i got just the source code... Any assistance will be very helpfull... -pranshu.a.11@gmail.com Okay, I am writing a new form validation script that also keeps the data so it can re-populate the fields the user already filled out if there is an error on the page so they do not have to fill it out again. Here is an example of the code I am using in the HTML part of the form input elements. <input name="name" type="text" id="name" value="<?php=$fields['name']?>"> Now, the problem I am getting is the <?php=$fields['name']?> code is being physically displayed within the form field at all times. How would I go about having it not display this line of code in the field? Thanks!! I have made a php cart : check it out on http://fhcs.be/cart-demo4/ My question is: when I order something by clicking on the "voeg toe" button, I'm redirected to the shopping cart. But I don't want to be redirected to the shopping cart, I want to stay on de menu list. What is an easy way to fix this? thanks people index.php Code: [Select] <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>PHP Shopping Cart Demo · Bookshop</title> <link rel="stylesheet" href="css/styles.css" /> </head> <body> <div id="shoppingcart"> <h1>Welkom, plaats uw order</h1> </div> <div id="booklist"> <h1>Warme dranken</h1> <?php $sql = 'SELECT * FROM products WHERE cat=2'; $result1 = $db->query($sql); $output1[] = '<ul>'; while ($row = $result1->fetch()) { $output1[] = '<li>'.$row['name'].': €'.$row['price'].'<br /><a href="cart.php?action=add&id='.$row['id'].'">Voeg Toe</a></li>'; } $output1[] = '</ul>'; echo join('',$output1); ?> <h1>Cocktails</h1> <?php $sql = 'SELECT * FROM products WHERE cat=3'; $result2 = $db->query($sql); $output2[] = '<ul>'; while ($row = $result2->fetch()) { $output2[] = '<li>'.$row['name'].': €'.$row['price'].'<br /><a href="cart.php?action=add&id='.$row['id'].'">Voeg Toe</a></li>'; } $output2[] = '</ul>'; echo join('',$output2); ?> </div> </body> cart.php Code: [Select] <?php // Include MySQL class require_once('inc/mysql.class.php'); // Include database connection require_once('inc/global.inc.php'); // Include functions require_once('inc/functions.inc.php'); // Start the session session_start(); // Process actions $cart = $_SESSION['cart']; $action = $_GET['action']; switch ($action) { case 'add': if ($cart) { $cart .= ','.$_GET['id']; } else { $cart = $_GET['id']; } break; case 'delete': if ($cart) { $items = explode(',',$cart); $newcart = ''; foreach ($items as $item) { if ($_GET['id'] != $item) { if ($newcart != '') { $newcart .= ','.$item; } else { $newcart = $item; } } } $cart = $newcart; } break; case 'update': if ($cart) { $newcart = ''; foreach ($_POST as $key=>$value) { if (stristr($key,'qty')) { $id = str_replace('qty','',$key); $items = ($newcart != '') ? explode(',',$newcart) : explode(',',$cart); $newcart = ''; foreach ($items as $item) { if ($id != $item) { if ($newcart != '') { $newcart .= ','.$item; } else { $newcart = $item; } } } for ($i=1;$i<=$value;$i++) { if ($newcart != '') { $newcart .= ','.$id; } else { $newcart = $id; } } } } } $cart = $newcart; break; } $_SESSION['cart'] = $cart; ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>PHP Shopping Cart Demo · Cart</title> <link rel="stylesheet" href="css/styles.css" /> </head> <body> <div id="shoppingcart"> <h1>Uw bestelling</h1> <?php echo writeShoppingCart(); ?> </div> <div id="contents"> <h2>Gelieve na te kijken voordat u bestelt</h2> <?php echo showCart(); ?> <p><a href="index.php">Terug naar lijst</a></p> <form action="mail.php" method="post"> <input type="submit" name="sendemail" value="Bestel" /> <input type="hidden" name="cart" value="<?= $cart; ?>" /> </form> </div> </body> </html> Hey guys, I've kind of taken over a project from a friend. It's a leaderboard for posting splits for drivers. The splits get posted to a leaderboard.xsl (which is working fine). The update.php page is designed to update a leaderboard.xml file, this way anyone can login and update new splits for each weeks race. (more info can be found here if you are curious). I found a small bug in the leaderboard.xsl file. It is meant for displaying the drivers splits, calculating the difference between drivers, what division they are, car they used and includes a 'Controller' column. This is where the bug is. Normally, it will display if that driver uses a gamepad or a steering wheel. If it's a one lap aka 'hotlap' race, the Controller column shows either a 'wheel' or 'controller' as it should. However, if it's a multi-lap race (2+ laps), then the Controller column automatically defaults to the <xsl:otherwise> option of a "?". Here is an example of the Controller column working properly for each driver: Here is what it does when there are two (or more) sets of splits for each driver on the leaderboard: The code makes the post over the character length, you can view the code here. Any assistance/help would be great appreciated as I'll be done with the project then Jerome Hi, my name is Michael Vallier and I am the director of Killer Film Fest. This year I have incorporated some new features and need some php help. If you are able to help with either or both problems, please let me know. Thanks in advance. 1. I am using a forum and I need help customizing it. I have no idea what I am doing. I have changed a few things, but don't know enough to do what I want. I don't need anything crazy, just to fit the look of our website. The forum is not open yet but you can see it he http://www.killerfilmfest.com/forum/ 2. I found a add-on to my website which is a file manager. People can create an account and upload files to my FTP server. I want to use this for filmmakers to upload their films if they choose to do it this way. There is a 10mb limit and it is possible to make it unlimited. I contacted the creator of the application and he led me to a wiki page with the directions. It looked real simple and I tried to do this but without any luck. So if there is anyone out there who can help, that would be great. Thanks -Michael Vallier- People on this forum have given me great advise. Now I almost have my login PHP correct. One thing is going wrong. (has to be my code) When I run the login and have it processed, it falls through the testing directly to the error statements. Checked the code but I cant figure it out. Been playing with it for 3 hours. I'll be highly grateful if someone out there can solve this. My code: <?php // Open members db - ceck to ensure user is not previously logged in - if no log yhe user in to the mem_log table. // If yes display appropriate error message. /// Page Name: login.php /// Date: 11-7-10 Time: 5:34 /// Tested: 11-7-10 by: bnl include "include/session.php"; include "include/z_db.php"; $userName=$_POST['userName']; $password=$_POST['password']; ?> <!doctype html> <html> <head> <title>Taft Union High School Alumni Class of 1965</title> <meta name="GENERATOR" content="NotePad++"> <meta name="FORMATTER" content="NotePad++"> </head> <body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000"> <?php $userName=mysql_real_escape_string($userName); $passWord=mysql_real_escape_string($passWord); $sql_query = mysql_query("SELECT * FROM `signup` WHERE `userName`='$userName' AND `passWord` = '$passWord' LIMIT 1"); if (mysql_num_rows($sql_query) > 0) { //log session data include "include/newsession.php"; $tm=date("Y-m-d H:i:s"); //$ip=@$REMOTE_ADDR; // The above line is commented and the line below is used for the servers where register_global=Off $ip=$_SERVER['REMOTE_ADDR']; echo $ip; $rt=mysql_query("insert into mem_login(id,userName,ip,tm) values('$_SESSION[id]','$_SESSION[userName]','$ip','$tm')"); // Username and password passed redirect to memPage header("location: memPage.html"); session_unset(); } else { // RUN YOUR ERROR MESSAGE echo " <div style='width:350px; border: medium ridge navy; background-color:gold; padding:10px;' > <table border='0' cellspacing='0' cellpadding='3' align='center bgcolor='gold'> <th style='font-weight:bold; fony-size:1,4em;color:#FFFFFF;background-color:red;'> INCORRECT USERNAME OR PASSWORD <hr> </th> <tr> <td>The username or Password was not located in the database, Check to ensure you have the correct information. If you need assistance, contact the site administrator at: <br> http://www.admin@tuhs-class65.c9m. <br><br> <center> <input type='button' value='Retry' onClick='history.go(-1)'> </center> </td> </tr> </table> </div> "; } ?> </body> </html> I know the program is working as the includes are being pulle in. I also have two records in the table. echo "<tr> <td class='trow2' align='center' valign='center' width='1'></td> <td class='trow2' valign='center'> <strong><a href='server.php?view=details&id=" . $list['id'] . "'>" . capitalizeFirstCharacter($list['servername']) . "</a></strong> <div class=\"stat2\"> <div class=\"stat\"> if(!$sock=@fsockopen($list_f['serverip'],$list_f['serverport'], $num, $error, 1)) { echo "<font color='red'><b>Offline</b></font>"; } else { echo "<font color='green'><b>Online</b></font>"; } </div> </div> <div class='smalltext'>" . $list['shortdescription'] . "</div> </td> <td class='trow1' valign='middle' align='left' style='white-space: nowrap'><span class='smalltext'>" . $list['revision'] . "</span></td> <td class='trow2' valign='middle' align='right' style='white-space: nowrap'><font size='4px'>" . $voteAmount . " Votes</font></td> </tr>"; How can I make this echo code work? Hi, i have a class which i am writing(just a small test) which is supposed to create a label for a form but nothing is showing up. Here is the html part: $frobj=new asf_form(); $frobj->form_label('Username'); and here is the class code: function form_label($label='') { if($label == '') { return false; } else { return '<label for='.$label.'>'.$label; } } Have i done something wrong? the problem im getting is with this line in the bootstrap Code: [Select] $this->view->head_title('test'); the view property is only initiated in the league_controller and $this->view doesnt exsist within the bootstap but i call the bootstrap header in the league controller and it wont let me execute the head title...if anyone can help me on why or how i can over come this please....thank you (code below) bootstrap Code: [Select] public static function header() { $this->view->head_title('test'); } leaugue_controller method Code: [Select] public function league($game_name, $league_name) { Bootstrap::header(); $rows = $this->leagues->fetch_league($game_name, $league_name); $this->view->head_title()->set_separator()->prepend('hello'); $this->view->rows = $rows; Bootstrap::footer(); } it says i have an error in in line 23 which is i cant seem to find it Code: [Select] <?php if($_POST['loginbtn']){ require "scripts/connect.php"; $email = mysql_real_escape_string($_POST['email']); $password = mysql_real_escape_string($_POST['password']); if($email && $password){ $password = md5("$password"); $query = mysql_query("SELECT * FROM ezadmin WHERE email = '$email'"); $numrows = mysql_num_rows($query); if($numrows != 0){ $row = mysql_fetch_assoc($query); //line 23 $dbemail = $row ['email']; $dbpassword = $row ['password']; if($dbemail === $email && $dbpassword === $password){ $_SESSION['email'] = $dbemail; header("location: adminpanel"); exit(); }else $msg = "PLEASE CHECK YOU EMAIL OR PASSWORD!"; }else $msg = "PERSON DOES NO EXSIT!"; }else $msg = "YOU MUST FILL IN ALL FIELDS!"; mysql_close(); } ?> <?php // SQL Connection $username="root"; $password=""; $database="mydb"; $connection = mysql_connect("localhost", $username, $password) or die("Connection Failure to Database"); // Select Database mysql_select_db($database, $connection) or die ($database . "No Database" . $username); $id = $_GET['id']; $MyQuery = "SELECT * FROM bookings WHERE id = '$id'"; $retrieve = mysql_query($MyQuery) or die(mysql_error()); if(mysql_num_rows($retrieve) != 0): $row = mysql_fetch_assoc($retrieve); endif; $idX = ($row['id']); echo $idX; if(mysql_num_rows($retrieve) == 0) { echo '<blink><font color="red"><strong>No Booking Found</strong></font></blink>'; } else { echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<table width="350">'; echo ' <tr>'; echo ' <td width="100">Full Name</td>'; echo ' <td width="100"><input style="width: 235px" value="' . ($row['fullname']) . '" type="text" name="fullname"></td>'; echo ' </tr>'; echo ' <tr>'; echo ' <td width="100">Address</td>'; echo ' <td width="100"><input style="width: 235px" value="' . ($row['address']) . '" type="text" name="address"></td>'; echo ' </tr>'; echo ' <tr>'; echo ' <td width="100">City</td>'; echo ' <td width="100"><input style="width: 235px" value="' . ($row['city']) . '" type="text" name="city"></td>'; echo ' <tr>'; echo ' <td width="100">Postcode</td>'; echo ' <td width="100"><input style="width: 235px" value="' . ($row['postcode']) . '" type="text" name="postcode"></td>'; echo ' </tr>'; echo ' <tr>'; echo ' <td width="100">Country</td>'; echo ' <td width="100"><select style="width: 235px" name="country">'; echo ' <option value="' . ($row['country']) . '">' . ($row['country']) . '</option>'; echo ' <option></option><option value="Abkhazia">Abkhazia</option><option value="Afghanistan">Afghanistan</option><option value="Aland">Aland</option><option value="Albania">Albania</option><option value="Algeria">Algeria</option><option value="American Samoa">American Samoa</option><option value="Andorra">Andorra</option><option value="Angola">Angola</option><option value="Anguilla">Anguilla</option><option value="Antarctica">Antarctica</option><option value="Antigua and Barbuda">Antigua and Barbuda</option><option value="Argentina">Argentina</option><option value="Armenia">Armenia</option><option value="Aruba">Aruba</option><option value="Ascension">Ascension</option><option value="Ashmore and Cartier Islands">Ashmore and Cartier Islands</option><option value="Australia">Australia</option><option value="Australian Antarctic Territory">Australian Antarctic Territory</option><option value="Austria">Austria</option><option value="Azerbaijan">Azerbaijan</option><option value="Bahamas, The">Bahamas, The</option><option value="Bahrain">Bahrain</option><option value="Baker Island">Baker Island</option><option value="Bangladesh">Bangladesh</option><option value="Barbados">Barbados</option><option value="Belarus">Belarus</option><option value="Belgium">Belgium</option><option value="Belize">Belize</option><option value="Benin">Benin</option><option value="Bermuda">Bermuda</option><option value="Bhutan">Bhutan</option><option value="Bolivia">Bolivia</option><option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option><option value="Botswana">Botswana</option><option value="Bouvet Island">Bouvet Island</option><option value="Brazil">Brazil</option><option value="British Antarctic Territory">British Antarctic Territory</option><option value="British Indian Ocean Territory">British Indian Ocean Territory</option><option value="British Sovereign Base Areas">British Sovereign Base Areas</option><option value="British Virgin Islands">British Virgin Islands</option><option value="Brunei">Brunei</option><option value="Bulgaria">Bulgaria</option><option value="Burkina Faso">Burkina Faso</option><option value="Burundi">Burundi</option><option value="Cambodia">Cambodia</option><option value="Cameroon">Cameroon</option><option value="Canada">Canada</option><option value="Cape Verde">Cape Verde</option><option value="Cayman Islands">Cayman Islands</option><option value="Central African Republic">Central African Republic</option><option value="Chad">Chad</option><option value="Chile">Chile</option><option value="China, Peoples Republic of">China, Peoples Republic of</option><option value="China, Republic of (Taiwan)">China, Republic of (Taiwan)</option><option value="Christmas Island">Christmas Island</option><option value="Clipperton Island">Clipperton Island</option><option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option><option value="Colombia">Colombia</option><option value="Comoros">Comoros</option><option value="Congo, Democratic Republic of the (Congo Kinshasa)">Congo, Democratic Republic of the (Congo Kinshasa)</option><option value="Congo, Republic of the (Congo Brazzaville)">Congo, Republic of the (Congo Brazzaville)</option><option value="Cook Islands">Cook Islands</option><option value="Coral Sea Islands">Coral Sea Islands</option><option value="Costa Rica">Costa Rica</option><option value="Cote dIvoire (Ivory Coast)">Cote dIvoire (Ivory Coast)</option><option value="Croatia">Croatia</option><option value="Cuba">Cuba</option><option value="Cyprus">Cyprus</option><option value="Czech Republic">Czech Republic</option><option value="Denmark">Denmark</option><option value="Djibouti">Djibouti</option><option value="Dominica">Dominica</option><option value="Dominican Republic">Dominican Republic</option><option value="Ecuador">Ecuador</option><option value="Egypt">Egypt</option><option value="El Salvador">El Salvador</option><option value="Equatorial Guinea">Equatorial Guinea</option><option value="Eritrea">Eritrea</option><option value="Estonia">Estonia</option><option value="Ethiopia">Ethiopia</option><option value="Falkland Islands (Islas Malvinas)">Falkland Islands (Islas Malvinas)</option><option value="Faroe Islands">Faroe Islands</option><option value="Fiji">Fiji</option><option value="Finland">Finland</option><option value="France">France</option><option value="French Guiana">French Guiana</option><option value="French Polynesia">French Polynesia</option><option value="French Scattered Islands in the Indian Ocean">French Scattered Islands in the Indian Ocean</option><option value="French Southern and Antarctic Lands">French Southern and Antarctic Lands</option><option value="Gabon">Gabon</option><option value="Gambia, The">Gambia, The</option><option value="Georgia">Georgia</option><option value="Germany">Germany</option><option value="Ghana">Ghana</option><option value="Gibraltar">Gibraltar</option><option value="Greece">Greece</option><option value="Greenland">Greenland</option><option value="Grenada">Grenada</option><option value="Guadeloupe">Guadeloupe</option><option value="Guam">Guam</option><option value="Guatemala">Guatemala</option><option value="Guernsey">Guernsey</option><option value="Guinea">Guinea</option><option value="Guinea-Bissau">Guinea-Bissau</option><option value="Guyana">Guyana</option><option value="Haiti">Haiti</option><option value="Heard Island and McDonald Islands">Heard Island and McDonald Islands</option><option value="Honduras">Honduras</option><option value="Hong Kong">Hong Kong</option><option value="Howland Island">Howland Island</option><option value="Hungary">Hungary</option><option value="Iceland">Iceland</option><option value="India">India</option><option value="Indonesia">Indonesia</option><option value="Iran">Iran</option><option value="Iraq">Iraq</option><option value="Ireland">Ireland</option><option value="Isle of Man">Isle of Man</option><option value="Israel">Israel</option><option value="Italy">Italy</option><option value="Jamaica">Jamaica</option><option value="Japan">Japan</option><option value="Jarvis Island">Jarvis Island</option><option value="Jersey">Jersey</option><option value="Johnston Atoll">Johnston Atoll</option><option value="Jordan">Jordan</option><option value="Kazakhstan">Kazakhstan</option><option value="Kenya">Kenya</option><option value="Kingman Reef">Kingman Reef</option><option value="Kiribati">Kiribati</option><option value="Korea, Democratic Peoples Republic of (North Korea)">Korea, Democratic Peoples Republic of (North Korea)</option><option value="Korea, Republic of (South Korea)">Korea, Republic of (South Korea)</option><option value="Kosovo">Kosovo</option><option value="Kuwait">Kuwait</option><option value="Kyrgyzstan">Kyrgyzstan</option><option value="Laos">Laos</option><option value="Latvia">Latvia</option><option value="Lebanon">Lebanon</option><option value="Lesotho">Lesotho</option><option value="Liberia">Liberia</option><option value="Libya">Libya</option><option value="Liechtenstein">Liechtenstein</option><option value="Lithuania">Lithuania</option><option value="Luxembourg">Luxembourg</option><option value="Macau">Macau</option><option value="Macedonia">Macedonia</option><option value="Madagascar">Madagascar</option><option value="Malawi">Malawi</option><option value="Malaysia">Malaysia</option><option value="Maldives">Maldives</option><option value="Mali">Mali</option><option value="Malta">Malta</option><option value="Marshall Islands">Marshall Islands</option><option value="Martinique">Martinique</option><option value="Mauritania">Mauritania</option><option value="Mauritius">Mauritius</option><option value="Mayotte">Mayotte</option><option value="Mexico">Mexico</option><option value="Micronesia">Micronesia</option><option value="Midway Islands">Midway Islands</option><option value="Moldova">Moldova</option><option value="Monaco">Monaco</option><option value="Mongolia">Mongolia</option><option value="Montenegro">Montenegro</option><option value="Montserrat">Montserrat</option><option value="Morocco">Morocco</option><option value="Mozambique">Mozambique</option><option value="Myanmar (Burma)">Myanmar (Burma)</option><option value="Nagorno-Karabakh">Nagorno-Karabakh</option><option value="Namibia">Namibia</option><option value="Nauru">Nauru</option><option value="Navassa Island">Navassa Island</option><option value="Nepal">Nepal</option><option value="Netherlands">Netherlands</option><option value="Netherlands Antilles">Netherlands Antilles</option><option value="New Caledonia">New Caledonia</option><option value="New Zealand">New Zealand</option><option value="Nicaragua">Nicaragua</option><option value="Niger">Niger</option><option value="Nigeria">Nigeria</option><option value="Niue">Niue</option><option value="Norfolk Island">Norfolk Island</option><option value="Northern Cyprus">Northern Cyprus</option><option value="Northern Mariana Islands">Northern Mariana Islands</option><option value="Norway">Norway</option><option value="Oman">Oman</option><option value="Pakistan">Pakistan</option><option value="Palau">Palau</option><option value="Palestine">Palestine</option><option value="Palmyra Atoll">Palmyra Atoll</option><option value="Panama">Panama</option><option value="Papua New Guinea">Papua New Guinea</option><option value="Paraguay">Paraguay</option><option value="Peru">Peru</option><option value="Peter I Island">Peter I Island</option><option value="Philippines">Philippines</option><option value="Pitcairn Islands">Pitcairn Islands</option><option value="Poland">Poland</option><option value="Portugal">Portugal</option><option value="Pridnestrovie (Transnistria)">Pridnestrovie (Transnistria)</option><option value="Puerto Rico">Puerto Rico</option><option value="Qatar">Qatar</option><option value="Queen Maud Land">Queen Maud Land</option><option value="Reunion">Reunion</option><option value="Romania">Romania</option><option value="Ross Dependency">Ross Dependency</option><option value="Russia">Russia</option><option value="Rwanda">Rwanda</option><option value="Saint Helena">Saint Helena</option><option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option><option value="Saint Lucia">Saint Lucia</option><option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option><option value="Saint Vincent and the Grenadines">Saint Vincent and the Grenadines</option><option value="Samoa">Samoa</option><option value="San Marino">San Marino</option><option value="Sao Tome and Principe">Sao Tome and Principe</option><option value="Saudi Arabia">Saudi Arabia</option><option value="Senegal">Senegal</option><option value="Serbia">Serbia</option><option value="Seychelles">Seychelles</option><option value="Sierra Leone">Sierra Leone</option><option value="Singapore">Singapore</option><option value="Slovakia">Slovakia</option><option value="Slovenia">Slovenia</option><option value="Solomon Islands">Solomon Islands</option><option value="Somalia">Somalia</option><option value="Somaliland">Somaliland</option><option value="South Africa">South Africa</option><option value="South Georgia and the South Sandwich Islands">South Georgia and the South Sandwich Islands</option><option value="South Ossetia">South Ossetia</option><option value="Spain">Spain</option><option value="Sri Lanka">Sri Lanka</option><option value="Sudan">Sudan</option><option value="Suriname">Suriname</option><option value="Svalbard">Svalbard</option><option value="Swaziland">Swaziland</option><option value="Sweden">Sweden</option><option value="Switzerland">Switzerland</option><option value="Syria">Syria</option><option value="Tajikistan">Tajikistan</option><option value="Tanzania">Tanzania</option><option value="Thailand">Thailand</option><option value="Timor-Leste (East Timor)">Timor-Leste (East Timor)</option><option value="Togo">Togo</option><option value="Tokelau">Tokelau</option><option value="Tonga">Tonga</option><option value="Trinidad and Tobago">Trinidad and Tobago</option><option value="Tristan da Cunha">Tristan da Cunha</option><option value="Tunisia">Tunisia</option><option value="Turkey">Turkey</option><option value="Turkmenistan">Turkmenistan</option><option value="Turks and Caicos Islands">Turks and Caicos Islands</option><option value="Tuvalu">Tuvalu</option><option value="U.S. Virgin Islands">U.S. Virgin Islands</option><option value="Uganda">Uganda</option><option value="Ukraine">Ukraine</option><option value="United Arab Emirates">United Arab Emirates</option><option value="United Kingdom">United Kingdom</option><option value="United States">United States</option><option value="Uruguay">Uruguay</option><option value="Uzbekistan">Uzbekistan</option><option value="Vanuatu">Vanuatu</option><option value="Vatican City">Vatican City</option><option value="Venezuela">Venezuela</option><option value="Viet Nam">Viet Nam</option><option value="Wake Island">Wake Island</option><option value="Wallis and Futuna">Wallis and Futuna</option><option value="Western Sahara">Western Sahara</option><option value="Yemen">Yemen</option><option value="Zambia">Zambia</option><option value="Zimbabwe">Zimbabwe</option></SELECT></td>'; echo ' </tr>'; echo ' <tr>'; echo ' <td width="100">Tel</td>'; echo ' <td width="100"><input style="width: 235px" value="' . ($row['tel']) . '" type="text" name="tel"></td>'; echo ' </tr>'; echo ' <tr>'; echo ' <td width="100">Email</td>'; echo ' <td width="100"><input style="width: 235px" value="' . ($row['email']) . '" type="text" name="email"></td>'; echo ' </tr>'; echo ' <tr>'; echo ' <td width="100">Info</td>'; echo ' <td width="100"><input style="width: 235px" value="' . ($row['info']) . '" type="text" name="info"></td>'; echo ' </tr>'; echo ' <tr>'; echo ' <td width="100">Checkin Date</td>'; echo ' <td width="100"><input style="width: 70px" value="' . ($row['checkin']) . '" type="text" name="checkin"></td>'; echo ' </tr>'; echo ' <tr>'; echo ' <td width="100">Checkout Date</td>'; echo ' <td width="100"><input style="width: 70px" value="' . ($row['checkout']) . '" type="text" name="checkout"></td>'; echo ' </tr>'; echo ' <tr>'; echo ' <td width="100"></td>'; echo ' <td width="100"><input type="submit" name="editbooking" value="Update Booking"></td>'; echo ' </tr>'; echo '</table>'; echo '<input type="hidden" name="source">'; echo '</form>'; } if (isset($_POST['editbooking'])) { $fullname = $_POST['fullname']; $address = $_POST['address']; $city = $_POST['city']; $postcode = $_POST['postcode']; $country = $_POST['country']; $tel = $_POST['tel']; $email = $_POST['email']; $info = $_POST['info']; $checkin = $_POST['checkin']; $checkout = $_POST['checkout']; $source = 'Manual Add'; $id_update = ($row['id']); $SQL = "UPDATE bookings SET fullname = '$fullname', address = '$address', city = '$city', postcode = '$postcode', country = '$country', tel = '$tel', email = '$email', info = '$info', checkin = '$checkin', checkout = '$checkout', source = '$source' WHERE id = '$id_update'"; error_reporting(0); $result = mysql_db_query($database,"$SQL"); header("location:index.php#bookings"); } ?> Where am I going wrong here? It simply won't update the query but if I change $id to 27 for example it will edit it?? Okay, let's say I have a block of text like so; 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 I need to be able to add more/less digits to the text. Like so; 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 etc Also if it's greater than a certain number, to subtract. :3 How would I go about doing that? Thank you, Doctor |