PHP - Php Website Script Problem
So I'm working on a website for an airline (not real) and on one of my pages you can request the cost of a flight by putting in the depart and arrival locations, like this:
And if they put in a selection that isn't in the database they get this: The problem is that when they load the page initially, instead of just the selection bars and sumbit button showing up, it all does and i get an error like this: When you sumbit it, it all looks like it should, it's just that when they load it things seem to go wrong, any idea how i can fix this? Heres the code i use: Code: [Select] <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <p>Depart: <select name="depart"> <option selected="selected">Bristol</option> <option>Newcastle</option> <option>Manchester</option> <option>Dublin</option> <option>Glasgow</option> </select> Arrive: <select name="arrive"> <option>Bristol</option> <option selected="selected">Newcastle</option> <option>Manchester</option> <option>Dublin</option> <option>Glasgow</option> </select> <input type="submit" /> </p> </form> <?php $depart = $_POST['depart']; $arrive = $_POST['arrive']; $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("test", $con); $result = mysql_query("SELECT price FROM flights WHERE depart = '$depart' AND arrive = '$arrive'"); if ($row = mysql_fetch_assoc($result)) { echo 'This flight shall cost you £'; echo $row["price"]; } else include('includes/price.php'); ?> </div> My if-else statement doesn't seem to be doing it's job Thanks in advance Similar TutorialsGood day programmers, please I'm a novice in coding and I need help with a script where people can send invitation message to their friend on my site as sms. I want users on my site to just drop the phone number of their friends only in the html form and it automatically sends the message I have configured to the number the member placed in the form. I'm hosted with hostgator, though I'm in nigeria, I run SMF 2.0.1 forum on my site, my targeted members are nigerians too. I have sms gateway with bbnsms.com, please guyz I need the script and html form for only phone number field(No message Field) as I want to send the same message that I already compose to all the phone numbers. Thanks guyz. Hi! I am working on a web page running a php script to extract from another website water temperatures from around the area. I have been working on this for about a month, and dont know how to do this. Here is where I am trying to grab the data from: http://www.lrn.usace.army.mil/pao/lakeinfo/CEN.htm --------------------------------------------------------------------------------- This is the data I need to obtain: Fishing is reported to be fair. Bass are being caught on spinnerbaits, plastic worms and jigs. Some Crappie are being caught on jigs and minnows. Trout are being taken in the tailwater area. The lake elevation is 633.87 feet above mean sea level. The water temperature is 58.0 degrees on the surface, 50.0 degrees at 10 feet. Ensure all required safety equipment is onboard your boat and in workable condition. I am wanting to do this for a couple of other lakes with the same data format. Can anyone help? Thanks in advance! Mike Does anybody know any good aplication that is free, to back up a website? i need to back it up every day. Or does someone have the php script for the same purpose? thanks! hii..
i want a travel search engine script in php website. i am searching for 2 to 3 days on it.
but i dont know how to start. i searched on google. find sme APIs for it. but where to implement those APIs. what code i need to write for it.
it would be grateful if anyone give some suggestions on this.
thanks and regards.
Hello !
How I can make a script of my PHP code to work even if my website is not running
Can I make this with php ?
I am developing paid property listing php website, I do not have al lot of scripting/database experience that is why I am farming this part of the work out. This website will provide a listing service which real estate agents can go to the site and look at the properties. They can search by Zip, city, or Sale by Owner. Alternatively, they can look at all the properties or recently posted. They will be able to see one tiny thumbnail with limited info like zip code/city. In order to see more pictures or get address info they will need to sign up and pay for each property to get more pics/info. So I need the script/scripts to do the following: 1. Provide all the search criteria as listed above (search by zip, search by city, Sale by Owner, Page that populates all the properties) 2. Provide a database interface so that I can upload the pics and enter new entries that will dynamically embed into my site. 3. Provide user access (new and existing) 4. Provide a shopping cart and payment gateway (Provide options for both Paypal and traditional Credit Card payment gateways) which will then allow the user access to the full info. 5. Must be able to integrate into my existing website/CSS If you are wondering if this will work, do not worry. My guy is taking the pics and getting the info has been getting business from real estate agents with this by word of mouth, it will work. Let me know ASAP as I am taking bids and looking to implement quickly. I can send a mock up by the man doing the property finding. Let me know what other info you need in order to get an accurate quote. best regards, Jordan McGehee I need like, http://www.trackcourier.in/ The customer chooses selected courier service and enters tracking id then clicks its redirect to the appropriate courier service website. eg: If tracking id 12345 the redirect link should be https://www.fedex.com/apps/fedextrack/index.html?tracknumbers=12345&cntry_code=in How to do for India courier services? Hi, I have create a small website with a login, over the past month it has been working fine, however today I tried to login and it says incorrect password. So I go into my phpMyAdmin database and change the password with the function type as PASSWORD. I go to login again and it still doesnt work. I did however have a dummy account on the site and that does work, and the only difference I can see is the encryption of the password, the new passwords I create start with the astrix symbol (*) and the old password that works doesnt have that. I can guess im probably using the wrong encryption type, but Iv tried loads of different ones and still nothing. I have however noticed which line of code in my PHP code isnt working for the new Passwords, but I cant see a problem. I have put it below, if anyone knows what the problem is, please, please, please let me know. Code: [Select] if ($pwd === PwdHash($pass,substr($pwd,0,9))) { It fails at this point and goes strait to the else at the bottom of the if statement. Thanks Ben p.s. if you want me to post all the Login code I will happily do so. I am using wampserver to run my website but i keep getting error when i type in localhost in my address bar Is it the problem with wampserver or the coding? The Error Quote Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: localhost in C:\wamp\www\libs\dmssql.php on line 35 Cant Connect to mssql [dmssql class] here is the config.php Quote ##### Template Dir ########### $template = 'default'; ##### Server Name $title = 'RoseCP AE'; ###### Your msSQL Info ######## $hostname = "localhost"; $username = "sa"; $password = ""; # databases, that if you changed db names. if not, dont change a thing $seven_ORA = "seven_ORA"; $sho = "SHO"; $sho_log = "SHO_LOG"; $sho_mall = "SHO_MALL"; And here is the dmssql.php Quote ##### Template Dir ########### $template = 'default'; ##### Server Name $title = 'RoseCP AE'; ###### Your msSQL Info ######## $hostname = "localhost"; $username = "sa"; $password = ""; # databases, that if you changed db names. if not, dont change a thing $seven_ORA = "seven_ORA"; $sho = "SHO"; $sho_log = "SHO_LOG"; $sho_mall = "SHO_MALL"; And here is the dmssql.php Quote class dmssql { function dmssql($h,$u,$p,$d) { $this->host = $h; $this->user = $u; $this->pass = $p; $this->db = $d; } function connect() { $this->linkid = mssql_connect($this->host,$this->user,$this->pass) or die("Cant Connect to mssql [dmssql class]"); if ($this->linkid) { if (mssql_select_db($this->db)) { return TRUE; } else { $this->dbclose($this->linkid); echo "Cant Select $this->db [dmssql class]"; return FALSE; } } else { echo "Cant Connect to mssql [dmssql class]"; return FALSE; } } function query($q) { if ($this->connect()) { $q = $this->clean($q); $r = mssql_query($q) or die("FATAL ERROR"); return $r; } } function clean($string) { $new_data = preg_replace("[^A-Za-z0-9@.]", "", $string); return $new_data; } function num_rows($data) { return mssql_num_rows($data); } function qFirstRow($q) { if ($this->connect()) { $ret = mssql_fetch_row($this->query($q)); } return $ret[0]; } function fetch_array($data) { return mssql_fetch_array($data); } function dbclose() { return mssql_close($this->linkid); } } ?> Can you help me Please Guys :X i enbaled php_mssql.dll and i replaced from ;extension php_mssql.dll to extension php_mssql.dll Could you help me guys please X.x HERE IS The full website code im using http://uploading.com/files/get/8de48e5m/ Hi, I have uploaded a website for someone but they are having problems viewing it and are telling me that nothing comes up. Not sure if its a dns problem. The domain was registered 2 days ago. Can a couple of you please check and tell me if this site loads up, it should show an ecommerce website : http://www.cassellmotors.com Many thanks, Scott I am helping a friend to fix their website and I dont have too much experience with php. I have noticed a problem with the language on one of the pages http://www.fincalavicaria.com/alameda.php When the page loads the Servicios shows in Spanish, which is correct however, if you click on the Servicios link it changes to the English version in the Spanish vesrion. This should only be available after you have changed the language for the site to english at the top As I dont have too much experience I would be grateful if someone could tell me what would be causing this to happen. It should be something very easy to fix but no matter what I try I can't find the problem. Thank you. Code: [Select] <?php $ACCEPT_FILE['home'] = 'home.html'; $ACCEPT_FILE['general'] = 'general.html'; $ACCEPT_FILE['attorneys'] = 'attorneys.html'; $ACCEPT_FILE['contact'] = 'contact.html'; $ACCEPT_FILE['login'] = 'login.html'; $pagename = $ACCEPT_FILE[$id]; if (!isset($pagename)) $pagename = "home.html"; // default file include( $pagename ); ?> the url looks like: www.yoursite.com/index.php?id=general Ever since i think like php 5 came out i am unnable to load pages it just defaults to the home.html no matter what variable is defined. any ideas or help would be appreciated. Its almost like its not defining the pagename variable until the bottom where $pagename = "home.html". ive been looking at it and reading the manuals for hours and figured its time to make a post. thanks. if ($action == "discussion") { if ($_POST['comment'] == "") { echo "<p align=center>Sorry your comment was not posted due to the comment being blank. You will be redirected in a few seconds so please try again</p> <p align=center>If you have not returned to your page <a href=http://www.sentuamessage.com/blog.php?who=$content[id]>Click Here</a>"; echo "<meta http-equiv=refresh content=15;URL=http://www.sentuamessage.com/blog.php?who=$content[id] />"; include("bottom.php"); exit; } if (isset($_POST) && !empty($_POST)) { if (isset($_SESSION['posttimer'])) { if ( (time() - $_SESSION['posttimer']) <= 10) { echo "<p align=center><b>Bit of a problem here, Double Post attempt has been found. Don't worry we stopped it.</b></p>"; echo "<p align=center>If you have not returned to your page <a href=http://www.sentuamessage.com/blog.php?who=$content[id]>Click Here</a>"; echo "<meta http-equiv=refresh content=15;URL=http://www.sentuamessage.com/blog.php?who=$content[id] />"; } else { $sumscore = $row[score] + 2; $sumcomments = $row[comments] + 1; $con=mysqli_connect("DETAILS FOR SQL STUFF IN HERE BUT DELETED FOR PURPOSES OF THE FORUM"); if (mysqli_connect_errno()) { echo "<p align=center>Failed to connect to MySQL: </p>" . mysqli_connect_error(); } $sql="INSERT INTO comments (userid, topicid, category, topicname, comment, date, name, address, avatar) VALUES ('$row[id]','$content[id]','blogs','$content[topic]','$_POST[comment]','$today','$row[name]','http://www.sentuamessage.com/blog.php?who=$content[id]', '$row[cavatar]')"; if (!mysqli_query($con,$sql)) { die('Error: ' . mysqli_error($con)); } mysql_query("INSERT INTO notifications (userid, username, nuser, message, address, date, time) VALUES ('$row[id]','$row[name]','$content[postedid]','$row[name] has commented on your Blog','http://www.sentuamessage.com/blog.php?who=$who','$today', '$time')") or die(mysql_error()); mysql_query("UPDATE userdb SET comments='$sumcomments', score='$sumscore' WHERE username='$_SESSION[username]'") or die(mysql_error()); echo "<p align=center>Your comment has been submitted. You should be redirected back to your page in a few seconds</p> <p align=center>If you have not returned to your page <a href=http://www.sentuamessage.com/blog.php?who=$content[id]>Click Here</a>"; echo "<meta http-equiv=refresh content=2;URL=http://www.sentuamessage.com/blog.php?who=$content[id] />"; mysqli_close($con); } } $_SESSION['posttimer'] = time(); } include("bottom.php"); exit; }I am rattling my brain here. I had added a code into my script to get rid of double posts, it has a timer which stops people double posting within 10 seconds. Though since inserting the code you have an error where you will have to double post the same post because instead of inserting the post content into the database the submit button comes back with a blank result. Why is this happening? (blank result instead of saying "post successfully posted etc." or "post not posted" it just comes up blank with no entry going into the database. This results in you having to re type your comment and re submit it hoping second time lucky) This is my code once the submit has been hit. Previously, the PHP codebase I was using was that written by others, and I used their code to tinker with so I could get an understanding how PHP works. Now that I am comfortable using PHP, I have written my own short PHP script from scratch with the aim of it seeing my newsletter system functioning at minimal, for the first time. The newsletters system is made with HTML/PHP/MySQL. I am having a problem with the PHP side of things where I am getting an error: Quote PHP Parse error: syntax error, unexpected T_IF on line 50 ... which is: Code: [Select] if $_POST['action'] == 'Register' { I am hoping someone that knows allot about PHP could take a look at my code and see whats wrong with it? PHP code within confirm.html: Code: [Select] <?php $link = mysql_connect('localhost', 'testusr', 'testpw'); mysql_select_db('testdb', $link); $email = $_POST['e-mail']; $query = if $_POST['action'] == 'Register' { if $_POST['newsletter'] == 'Mens' { "INSERT INTO newsletters(mens) VALUES('$email')"; } elseif $_POST['newsletter'] == 'Mens & Womens' { "INSERT INTO newsletters(mensandwomens) VALUES('$email')"; } elseif $_POST['newsletter'] == 'Womens' { "INSERT INTO newsletters(womens) VALUES('$email')"; } ;} mysql_query ($link, $query); mysql_close($link); ?> HTML FORM code within index.html: Code: [Select] <FORM action="confirm.html" method="post"> <DIV> <SPAN class="input"> Action: <SELECT name="action"> <OPTION>Register</OPTION> <OPTION>Unregister</OPTION> </SELECT>    E-mail: <INPUT name="e-mail" type="text"></INPUT>    Newsletter: <SELECT name="newsletter"> <OPTION>Mens</OPTION> <OPTION>Mens & Womans</OPTION> <OPTION>Womens</OPTION> </SELECT>    <INPUT class="submit" type="submit" value="Submit"> </SPAN> </DIV> </FORM> here is the basic script . i use this script for edit html or text file. <?php $action=$_POST['action']; $textarea=$_POST['textarea']; if($_GET['p']){ $page=$_GET['p']; } // Assume your text pages are called, p1.db or p2.db, etc. $url = "p".$page.".html"; if (file_exists($url)) { // do nothing } else { $url = "p0.txt"; } // where to go back to after the edit ... $return="page.php?p=$page"; // Get page $data = implode("", file($url)); if($action=="save"){ $newtext=stripslashes($textarea); $newtext = str_replace("<?", "", $newtext); $newtext = str_replace("?>", "", $newtext); $newtext = nl2br($newtext); //echo "page: $url<br><br>\n"; //echo $newtext; $fh = fopen($url, 'w') or die("can't open file"); fwrite($fh, $newtext); fclose($fh); header ("location: edit.php?p=$page"); } else{ echo" <html> <head><title>Simple Text Editor</title> <style> body,html{ margin:0px auto; width:700px; text-align:center; } #content{ margin:0px auto; width:700px; } #middle h1 { color: transparent; font-family:georgia; font-size:12pt; margin:0; color: #dF9100; padding:10px 0px 15px 0px; text-align:left; } </style> <body> <div id='content'> "; $ta=br2nl($data); echo" <a href='$return'><-- Return to Page</a><br /><br /> Make Changes and click \"Save Changes\" at the very bottom ...<br /> <form action='edit.php' method='post'> <input type='hidden' name='action' value='save'> <input type='hidden' name='p' value='$page'> <input type='hidden' name='n' value='$n'> <textarea name='textarea' rows='25' cols='80'>$ta</textarea> <br /> <input type='submit' name='submit' value='Save Changes'> </form> <div id='middle' style='width:680px; text-align:left; padding-left:20px; border:1px solid #ccc;'> </div> </div> </body> </html> "; } function br2nl($str) { return preg_replace('=<br */?>=i', "", $str); } ?> __________________ the script is running fine. but when i intregate tinymce with the script.. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>abeer cms</title> <script type="text/javascript" src="jscripts/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({ // General options mode : "textareas", theme : "advanced", plugins : "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager", // Theme options theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Example content CSS (should be your site CSS) content_css : "css/example.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "js/template_list.js", external_link_list_url : "js/link_list.js", external_image_list_url : "js/image_list.js", media_external_list_url : "js/media_list.js", // Replace values for the template plugin template_replace_values : { username : "Some User", staffid : "991234" } }); </script> </head> <body> <?php $action=$_POST['action']; $textarea=$_POST['textarea']; if($_GET['p']){ $page=$_GET['p']; } // Assume your text pages are called, p1.db or p2.db, etc. $url = "p".$page.".html"; if (file_exists($url)) { // do nothing } else { $url = "p0.html"; } // where to go back to after the edit ... $return="edit.php?p=$edit"; // Get page $data = implode("", file($url)); if($action=="save"){ $newtext=stripslashes($textarea); $newtext = str_replace("<?", "", $newtext); $newtext = str_replace("?>", "", $newtext); $newtext = nl2br($newtext); //echo "page: $url<br><br>\n"; //echo $newtext; $fh = fopen($url, 'w') or die("can't open file"); fwrite($fh, $newtext); fclose($fh); header ("location: edit.php?p=$page"); } else{ echo" <html> <head><title>Simple Text Editor</title> <style> body,html{ margin:0px auto; width:700px; text-align:center; } #content{ margin:0px auto; width:700px; } #middle h1 { color: transparent; font-family:georgia; font-size:12pt; margin:0; color: #dF9100; padding:10px 0px 15px 0px; text-align:left; } </style> <body> <div id='content'> "; $ta=br2nl($data); echo" <a href='$return'><-- Return to Page</a><br /><br /> Make Changes and click \"Save Changes\" at the very bottom ...<br /> <form action='edit.php' method='post'> <input type='hidden' name='action' value='save'> <input type='hidden' name='p' value='$page'> <input type='hidden' name='n' value='$n'> <textarea name='textarea' rows='25' cols='80'>$ta</textarea> <br /> <input type='submit' name='submit' value='Save Changes'> </form> <div id='middle' style='width:680px; text-align:left; padding-left:20px; border:1px solid #ccc;'> </div> </div> </body> </html> "; } function br2nl($str) { return preg_replace('=<br */?>=i', "", $str); } ?> __________________ </body> </html> the script show error message after clicking the save button. the error message is Warning: Cannot modify header information - headers already sent by (output started at c:\wamp\www\edit.php:6) in c:\wamp\www\edit.php on line 78 can any one help regarding this issue? Well this problem has occurred a lot. I try to put ". $_GET['site'] ." or ". $_POST['site'] ." in my script and i get a server errror when trying t access my page ( error connecting the page basically) Here is the part of the script which that is occuring to: Quote if($_GET['step'] == 2) { echo 'Just adding INCLUDE files'; exec('xcopy /X/ / ". $_GET['site'] ." / /e/i', $a, $a1); <---- This line echo '<form action="install.php?step=3&guid='. $my_guid .'" method="post">'; echo '<input type="submit" value="Continue">'; echo '</form>'; } When i try using the $_GET function or $_POST functions in alot of stuff it just shows an server error(error connecting the page on my browser) Someone please help! I'm having trouble with my script. I'm getting pictures from the database and showing it in 3 columns and putting some information in each table location with the picture. But I made a change and now the table still works but I get a full blank page and have to scroll down to see the pictures. Can anybody see where my problem exists, it was working fine but now it doesn't. Any help would be appreciated. Thanks in advance. Code: [Select] <!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" lang="en" xml:lang="en"> <title></title> <head> <link rel="stylesheet" href="./stylesheet/stylesheet1.css" media="screen"> <style type="text/css" media="screen">@import url("./stylesheet/stylesheet2.css");</style> </head> <body> <center><table cellspacing="5" cellpadding="5" width="800" border="1"> <?php include "connect.php"; $query = "SELECT * FROM promo_vet ORDER BY year"; $result = mysql_query($query) or die("There was a problem with the SQL query: " . mysql_error()); if($result && mysql_num_rows($result) > 0) { $i = 0; $max_columns = 3; while($row = mysql_fetch_array($result)) { // make the variables easy to deal with extract($row); // open row if counter is zero if($i == 0) echo "<tr>"; // make sure we have a valid product ALIGN='CENTER' if($year != "" && $year != null) echo "<td align='center'><a><img src=\"$picture\"></a><br>$testshot<FONT COLOR='red'><b>$year</b></FONT><br>$description <br> $boxno<br>$convertible<br>$coupe </td><BR>"; // increment counter - if counter = max columns, reset counter and close row if(++$i == $max_columns) { echo "</tr>"; $i=0; } // end if } // end while } // end if results // clean up table - makes your code valid! if($i < $max_columns) { for($j=$i; $j<$max_columns;$j++) echo "<td> </td>"; } ?> </tr> </table></center> </body> </html> Hey, so this is my register script
<?php error_reporting(E_ALL | E_NOTICE); ini_set('display_errors', 1); require 'connect.php'; echo "<title> Register </title>"; if(isset($_POST['register'])) { $username = trim($_POST['username']); $username = mysqli_real_escape_string($con, $_POST['username']); $password = mysqli_real_escape_string($con, $_POST['password']); $password = hash('sha512', $_POST['password']); if(!$_POST['username'] OR !$_POST['password']) { die("You must enter a username and password!"); } $stmt = $con->prepare("INSERT INTO usrs_usr (username, password) VALUES (?, ?)"); $stmt->bind_param("ss", $username, $password); $stmt->get_result(); var_dump($stmt); $stmt->execute(); echo "New user has been created successfully"; $stmt->close(); $conn->close(); } ?>Now the problem is i have done a variable dump which outputs nothing, and the only error i am getting is Fatal error: Call to a member function bind_param() on a non-object Hi all, Im coding a simple script for my website which just changes the users rank. Code: [Select] <?php session_start(); include "../includes/db_connect.php"; include "../includes/functions.php"; logincheck(); ini_set ('display_errors', 1); error_reporting (E_ALL); $username=$_SESSION['username']; $get = mysql_query ("SELECT * FROM users WHERE username = '$username'"); $fetch = mysql_fetch_object($get); if ($fetch->userlevel >= "2"){ $newrank = $_POST['newrank']; $user1 = $_POST['user']; if (strip_tags($_POST['update'])){ mysql_query("UPDATE users SET `rank` = '$newrank' WHERE username='$user1'") or die (mysql_error()); echo ("You have updated $user1's rank to $newrank !"); } } else{ echo ("Your userlevel isnt high enouth to be here!"); } ?> <html> <head> <title>Change Rank</title> <link rel="stylesheet" href="../includes/in.css" type="text/css"> <style type="text/css"> .infobg { font-family: Arial; font-weight:normal; font-size:12px; border-top: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; background: URL(textbg1.png); font-weight:300; } .button { font-size: 12px; background:url(button.png); vertical-align: middle; border-top: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; color: #FFFFCC; height:23px; font-weight:300; border-radius: 10px; padding-bottom:2px; } </style> </head> <body> <form action='' method='post' name='form1'> <table width='30%' cellpadding='0' align='center' cellspacing='0' border='1' bordercolor='#000000' bgcolor='#808080' style='border-collapse: collapse'> <tr> <td background='../header.jpg' colspan='2' align='center'>Change Rank</td> <tr> <td>Username:</td><td><input type='text' name='user'></td> </tr> <tr> <td>Rank:</td><td><input type='text' name='newrank'></td> </tr> <tr> <td> </td><td><input type="submit" name="update" value="Update Rank"></td> </tr> </form> </table> </body> </html> But there seems to be something wrong with that code, which I carnt see or work out. When I click Update submit button it does nothing, but can anyone see why it does nothing? Thanks. |