PHP - Getting Parse Error Simple Code Modification Needed
Hello Freaks!
I am having problem with following code: <?php simplexml_load_string ('?xml version="1.0" encoding="utf-8"?>'); php?> This code is giving me following error Parse error: syntax error, unexpected '<' in public_html/wp-content/plugins/pluginnamehere/whatever.php on line 665 I know there is only a minor bracket problem that causing me this error. I would be helpful to you if you can modify it for me Thanks Similar Tutorialsi have this code <?php require_once('dbconnect.php') $user = "test"; $pass = "test"; $result=mysql_query("SELECT * FROM accounts WHERE user = '$user' AND pass = '$pass' "); if(mysql_num_rows($result) == 0) { $login = "&err=Login Failed."; echo($login); } else { $row = mysql_fetch_array($result); $user = $row['user']; $pass = $row['pass']; $login = "&user=".$user."&pass=".$pass."&err=Login Successful."; echo($login); } ?> and im getting this Parse error: parse error in C:\wamp\www\flashstuff\WTF.php on line 4 line 4 is: $user = "test"; all the dbconnect stuff is fine help! Hi, I tried putting this Viglink code into my custom themes index.template.php on my SMF forum (I should do that right?) and I ended up with this error... Code: [Select] Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in .../Themes/androidrtk_rev4n/index.template.php on line 554 545: subMenusContainerId:\'admsubMenus\', 546: duration:\'150\' 547: }); 548: }); 549: } 550: </script> 551: 552: <script type="text/javascript"> 553: var vglnk = { api_url: '//api.viglink.com/api', 554: key: 'ad93febdf4e33c034d9635037b687fb3' }; 555: 556: (function(d, t) { 557: var s = d.createElement(t); s.type = 'text/javascript'; s.async = true; 558: s.src = ('https:' == document.location.protocol ? vglnk.api_url : I figured since it was a copy paste code that it would work just fine In any case, how can I fix this? Thanks in advance, Jimmy $BoxSize = array("smallbox" = array("length" => 12, "width" => 10, "depth" => 2.5), "mediumbox" = array("length" => 30, "width" => 20, "depth" => 4), "largebox" = array("length" => 60, "width" => 40, "depth" => 11.5)); Hello I have one problem with fwrite() I have one script to get width and height from javascript and echo it with PHP. echo "Screen width is: ". $_GET['width'] ."<br />\n"; echo "Screen height is: ". $_GET['height'] ."<br />\n"; It works but i want to store the result in a file fwrite($info,"Height: $_GET['height'] <br />"); But then I get error Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING //////////////////////// it would be even better if I don't have to print the values but directly store them in $iinfo sorry if something similar was soved but those examples were different or i was unable to transform it to solve my problem hi all am new to this forum help me to overcome from this error Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in D:\wamp\www\quiz1\quiz1.php on line 12 Code: [Select] <?php include("contentdb.php"); $display = mysql_query("SELECT * FROM $table ORDER BY id",$db); if (!$submit) { echo "<form method=post action=$_SERVER['PHP_SELF']>"; echo "<table border=0>"; while ($row = mysql_fetch_array($display)) { $id = $row["id"]; $question = $row["question"]; $opt1 = $row["opt1"]; $opt2 = $row["opt2"]; $opt3 = $row["opt3"]; $answer = $row["answer"]; echo "<tr><td colspan=3><br><b>$question</b></td></tr>"; echo "<tr><td>$opt1 <input type=radio name=q$id value=\"$opt1\"></td><td>$opt2 <input type=radio name=q$id value=\"$opt2\"></td><td>$opt3 <input type=radio name=q$id value=\"$opt3\"></td></tr>"; } echo "</table>"; echo "<input type='submit' value='See how you did' name='submit'>"; echo "</form>"; } elseif ($submit) { $score = 0; $total = mysql_num_rows($display); while ($result = mysql_fetch_array($display)) { $answer = $result["answer"]; $q = $result["q"]; if ($$q == $answer) { $score++; } } echo "<p align=center><b>You scored $score out of $total</b></p>"; echo "<p>"; if ($score == $total) { echo "Congratulations! You got every question right!"; } elseif ($score/$total < 0.34) { echo "Oh dear. Not the best score, but don't worry, it's only a quiz."; } elseif ($score/$total > 0.67) { echo "Well done! You certainly know your stuff."; } else { echo "Not bad - but there were a few that caught you out!"; } echo "</p>"; echo "<p>Here are the answers:"; echo "<table border=0>"; $display = mysql_query("SELECT * FROM $table ORDER BY id",$db); while ($row = mysql_fetch_array($display)) { $question = $row["question"]; $answer = $row["answer"]; $q = $row["q"]; echo "<tr><td><br>$question</td></tr>"; if ($$q == $answer) { echo "<tr><td>»you answered ${$q}, which is correct</td></tr>"; } elseif ($$q == "") { echo "<tr><td>»you didn't select an answer. The answer is $answer</td></tr>"; } else { echo "<tr><td>»you answered ${$q}. The answer is $answer</td></tr>"; } } echo "</table></p>"; } ?> thanks in adavance I am trying to put a href on a line to link me to another php module, but get an error: Parse error: parse error in C:\wamp\www\editpolicy.php on line 47 My code: while ($row2 = mysql_fetch_array($result2) ) { print "<tr><td>"; <a href='editpayment.php?payid=$row2[PaymentID]'>$row2[PaymentID]</a> .........THIS IS LINE 47 ??? print "</td><td>"; print $row2['Actioned']; print "</td><td align='right'>"; print $row2['PremiumPaidAmount']; print "</td><td align='right'>"; print $row2['Risk']; print "</td></tr>"; } Thank you for writing this script. It has been most helpful in doing a search for a website I manage. Everything is working fine but I would like some help in modifying the "$results[] = " line. For instance, I would like to show or hide the address of a business if a data value is set to 1 if set to 0 then hide. Same for the business web address. if ( $row_memberrs['WebAddress'] != NULL ) { echo <a href=\"{$row['WebAddress']}\" target=_blank>Visit our website</a>; } I am a newbie to php and would appreciate any help you can give me. Here is a link to the search page http://www.wildwoodba.org/searchsite.php If it is not too much trouble I would like to hide the check boxes and make it search the body, title or disc for the words entered. Thank you for your help. echo "</select></td>\r\n </tr>\r\n \r\n <tr>\r\n <td align=\"right\">Total Views Allowed:</td>\r\n <td><input type=\"text\" id=\"ad_total_views\" style=\"width:50px;\" value=\"\" disabled=\"disabled\" /> <label><input type=\"checkbox\" checked=\"checked\" onclick=\"if(this.checked==true){$('#ad_total_views').val('');$('#ad_total_views').attr('disabled','disabled');}else{$('#ad_total_views').val('');$('#ad_total_views').removeAttr('disabled');$('#ad_total_views').focus()}\" />Unlimited</label></td>\r\n </tr>\r\n \r\n <tr>\r\n <td align=\"right\">Total Clicks Allowed:</td>\r\n <td><input type=\"text\" id=\"ad_total_clicks\" style=\"width:50px;\" value=\"\" disabled=\"disabled\" /> <label><input type=\"checkbox\" checked=\"checked\" onclick=\"if(this.checked==true){$('#ad_total_clicks').val('');$('#ad_total_clicks').attr('disabled','disabled');}else{$('#ad_total_clicks').val('');$('#ad_total_clicks').removeAttr('disabled');$('#ad_total_clicks').focus()}\" />Unlimited</label></td>\r\n </tr>\r\n </table></td>\r\n </tr>\r\n <tr bgcolor=\"#FFFFFF\">\r\n <td class=\"td_th\" align=\"center\">Smarty Code (Developer)</td>\r\n <td>{\$ads->getAdCode(<span id=\"smartycode\">1</span>)}</td>\r\n </tr>\r\n <tr bgcolor=\"#FFFFFF\">\r\n <td class=\"td_th\" align=\"center\"> </td>\r\n <td><input type=\"button\" value=\"Create New Campaign\" onclick=\"new_ad()\" /></td>\r\n </tr>\r\n </TBODY></TABLE>\r\n<br />\r\n\r\n<TABLE cellSpacing=1 cellPadding=4 width=\"100%\" border=0>\r\n <TBODY>\r\n <TR class=\"td_title\">\r\n <TD colSpan=7>Ad Campaigns</TD></TR>\r\n <TR bgColor=#ffffff>\r\n \r\n <TD width=\"10%\" align=\"center\" class=\"td_th\"> </TD>\r\n <TD width=\"4%\" align=\"center\" class=\"td_th\">ID</TD>\r\n <TD width=\"29%\" align=\"center\" class=\"td_th\">Campaign Name</TD>\r\n <TD width=\"12%\" align=\"center\" class=\"td_th\">Start Date</TD>\r\n <TD width=\"11%\" align=\"center\" class=\"td_th\">End Date</TD>\r\n <TD width=\"17%\" align=\"center\" class=\"td_th\">Viewed / Views Allowed</TD>\r\n <TD width=\"17%\" align=\"center\" class=\"td_th\">Clicked / Clicks Allowed</TD>\r\n </TR>\r\n "; Hi,
I have the following code which gives a fading out effect when clicking on links. I need to be able to disable it for anchor links so it is disabled when using # as the link.
Any ideas ?
/* * Function to animate leaving a page */ $.fn.leavePage = function() { this.click(function(event){ // Don't go to the next page yet. event.preventDefault(); linkLocation = this.href; // Fade out this page first. $('body').fadeOut(400, function(){ // Then go to the next page. window.location = linkLocation; }); }); };Thanks, Scott. Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\mywork\unique.php on line 15 <html> <head> <title> </title> </head> <body bgproperties="fixed"> <?php $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = ''; $con = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); $dbname = 'mywork'; mysql_select_db($dbname, $con); $sql=mysql_query(insert into users (regno,name,gender,date,month,year,emailid,cell,paddress,caddress,incometype,incomeamt,dad,fyes,dadocup,mom,myes,momocup,password) VALUES ('$_POST[regno]','$_POST[name]','$_POST[gender]','$_POST[date]','$_POST[month]','$_POST[year]','$_POST[emailid]','$_POST[cell]','$_POST[paddress]','$_POST[caddress]','$_POST[incometype]','$_POST[incomeamt]','$_POST[dad]','$_POST[fyes]','$_POST[dadocup]','$_POST[mom]','$_POST[myes]','$_POST[momocup]','$_POST[password]')"); $sql1=mysql_fetch_array($sql); $result = @mysql_query($SQl1); $result="SELECT * FROM users WHERE regno='$regno'"; while($row = mysql_fetch_array($result)) { //echo $row['regno']."regno<br>"; //echo $row['name']."name<br>"; //echo $row['gender']."gender<br>"; //echo $row['date']."date<br>"; //echo $row['month']."month<br>"; //echo $row['year']."year<br>"; //echo $row['emailid']."emailid<br>"; //echo $row['cell']."cell<br>"; //echo $row['paddress']."paddress<br>"; //echo $row['caddress']."caddress<br>"; //echo $row['incometype']."incometype<br>"; //echo $row['incomeamt']."incomeamt<br>"; //echo $row['dad']."dad<br>"; //echo $row['fyes']."fyes<br>"; //echo $row['dadocup']."dadocup<br>"; //echo $row['mom']."mom<br>"; //echo $row['myes']."myes<br>"; //echo $row['momocup']."momocup<br>"; //echo $row['password']."password<br>"; } echo "Thanks for Register!"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "1 record added"; mysql_close($con); ?> <form name="security" action="index.php" method="post"> <input type="submit" value="click here to login"> </form> </body> </html> Code: [Select] This is a clip of my PHP file: <?php $con = mysql_connect($host,$username,$password); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db($database, $con); $result = mysql_query("SELECT * FROM purchase_order WHERE purchase_order_number=='$purchase_order_number'"); while($row = mysql_fetch_array($result)) { $vendor=$row['vendor']; $purchase_order_date=$row['purchase_order_date']; $ship=$row['ship']; $state=$row['state']; $fob=$row['fob']; $terms=$row['terms']; $buyer=$row['buyer']; $freight=$row['freight']; $req_date=$row['req_date']; $confirming_to=$row['confirming_to']; $remarks=$row['remarks']; $tax=$row['tax'] } // [i][u][b]<-- This is line 88 (The one with the error)[/b][/u][/i] ?>Thanks in advance! Okay, I have no idea how this works out but this is really getting on my nerves. Here is my logic for the following code. I manually register a user, It goes into the database and dispatches an email notification explaining that a user must activate their account and change their user name (OPTIONAL) and password. In the email, There is an automatically generated password with the username, And a link to activate the account. This leads to stage 1 of the activation process, In this stage the user is accepted, Registered as a verified user and then is sent to another page to change the details like login and password. As far as I know this page works except through trial and error I found that this little snippet of code is causing browsers to show an error 500 page, If I remove this the page works: <?php if($messages){ displayErrors($messages); } else { echo("<p align=\"center\" class=\"standard\">Your account has been activated.</p><p align=\"center\" class=\"standard\">You now need to change your password. If you like you can also change your username, Remember that you only have 3 days to do so and this change will be permanent.</p>"); } ?> and this is the displayErrors function: <?php function displayErrors($messages) { print("<p align=\"center\" class=\"standard\">"."<b>There were problems with the previous action:</b>\n<ul>\n"); foreach($messages as $msg){ print("<li>$msg</li>\n"); } print("</ul>\n"."</p>"); } ?> The displayErrors function is in a file called functions.php, Which is included in config.php, Which is included in every page including this one. The entire "Change password and login page thingie" is he <?php include("config.php"); global $link, $messages; require_once('recaptchalib.php'); if($_GET['error']){ $id=$_GET['id']; $messages[]="There is more than one or no accounts with the verification code you are using. <a href=\"mailto:rentals@nivso.co.uk?subject=Two or no accounts with activation ID of $id\">Click here to email us about this and have the problem sorted.</a>"; doIndex(); exit; } if(isset($_POST['submit'])){ if(!isset($_POST['activationid'])){ die("Doesn't exist -.- might as well quit this is *STUFF* -.-"); } $privatekey = "YOUR NOT HAVING THIS"; $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if (!$resp->is_valid) { $messages[]="The code you entered is incorrect. Please go back and try again!"; doIndex(); exit; // exit or the below lines will be processed. } else { //This is where the fun starts! $login=$_POST['login']; $passw=$_POST['password']; $passc=$_POST['passwordc']; $id2=$_POST['activationid']; $changinglogin=false; $get1=excDB("SELECT * FROM `users` WHERE `activeID`='$id2'"); if($get1[0]){ $get1=$get1[1]; } else { die($get1[2]); } $pro1=mysql_fetch_array($get1); if($pro1['login']!=$login){ $changinglogin=true; field_validator("Login", $login, "alphanumeric", 4, 15); } field_validator("Password", $passw, "string", 6, 20); if($passw!=$passc){ $messages[]="The passwords do not match, Please make sure that the passwords are the same!"; } if($messages){ doIndex(); exit; } $passcl=mysql_escape_string($passw); $passen=md5($passcl); if($changinglogin){ $wri1=excDB("UPDATE `users` SET `login`='$login', `password`='$passen', `passchange`='1', `loginchange`='1' WHERE `activeID`='$id2';"); if($wri1[0]){ $wri1=$wri1[1]; } else { die($wri1[2]); } header("Location: login.php?created"); } else { $wri1=excDB("UPDATE `users` SET `password`='$passen', `passchange`='1', `loginchange`='0' WHERE `activeID`='$id2';"); if($wri1[0]){ $wri1=$wri1[1]; } else { die($wri1[2]); } header("Location: login.php?created2"); } } } else { doIndex(); } function doIndex(){ ?> <!DOCTYPE html> <head> <title>Family Rental System! - Rent your DVDs here - Design by Alex, Coding by Gergy008</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link type="text/css" href="css/main.css" rel="stylesheet"> <style type="text/css"> <!-- body { background-color: #333333; } --> </style></head> <body style="text-align:center;"> <div class="first"> <div class="backgrounder1"></div> <div class="headerbar1"></div> <div class="headerbar2"></div> </div> <div align="center"> <table border="0" cellpadding="0" cellspacing="0" width="900"> <tr> <td><img src="images/spacer.gif" width="52" height="1" border="0" alt="" /></td> <td><img src="images/spacer.gif" width="123" height="1" border="0" alt="" /></td> <td><img src="images/spacer.gif" width="352" height="1" border="0" alt="" /></td> <td><img src="images/spacer.gif" width="33" height="1" border="0" alt="" /></td> <td><img src="images/spacer.gif" width="55" height="1" border="0" alt="" /></td> <td><img src="images/spacer.gif" width="110" height="1" border="0" alt="" /></td> <td><img src="images/spacer.gif" width="110" height="1" border="0" alt="" /></td> <td><img src="images/spacer.gif" width="50" height="1" border="0" alt="" /></td> <td><img src="images/spacer.gif" width="15" height="1" border="0" alt="" /></td> <td><img src="images/spacer.gif" width="1" height="1" border="0" alt="" /></td> </tr> <tr> <td colspan="9" background="images/template.slice.1.png"> </td> <td><img src="images/spacer.gif" width="1" height="20" border="0" alt="" /></td> </tr> <tr> <td colspan="5" background="images/template.slice.2.png"> </td> <td colspan="2" rowspan="2" background="images/template.slice.3.png"><span class="login"><?php echo(loginHandler()); ?></span></td> <td colspan="2" rowspan="3" background="images/template.slice.4.png"> </td> <td><img src="images/spacer.gif" width="1" height="30" border="0" alt="" /></td> </tr> <tr> <td rowspan="8" background="images/template.slice.5.png"> </td> <td colspan="2" background="images/template.slice.6.png"><form> <div align="center"> <input name="textfield" type="text" id="textfield" size="40" style="height:16px;"> <input type="submit" name="button" id="button" value="Search" style="height:20px;"> </div> </form></td> <td colspan="2" rowspan="2" background="images/template.slice.7.png"> </td> <td><img src="images/spacer.gif" width="1" height="30" border="0" alt="" /></td> </tr> <tr> <td colspan="2" rowspan="3" background="images/template.slice.8.png"><p> </p> <p> </p></td> <td colspan="2" background="images/template.slice.9.png"> </td> <td><img src="images/spacer.gif" width="1" height="70" border="0" alt="" /></td> </tr> <tr> <td rowspan="2" background="images/template.slice.10.png"> </td> <td colspan="4" background="images/template.slice.11.png"> </td> <td rowspan="6" background="images/template.slice.12.png"> </td> <td><img src="images/spacer.gif" width="1" height="30" border="0" alt="" /></td> </tr> <tr> <td colspan="4" background="images/template.slice.13.png"></td> <td><img src="images/spacer.gif" width="1" height="8" border="0" alt="" /></td> </tr> <tr> <td rowspan="4" background="images/template.slice.14.png"> </td> <td colspan="4" background="images/template.slice.15.png"> </td> <td colspan="2" rowspan="4" background="images/template.slice.16.png"> </td> <td><img src="images/spacer.gif" width="1" height="35" border="0" alt="" /></td> </tr> <tr> <td colspan="4" background="images/template.slice.17.png"> </td> <td><img src="images/spacer.gif" width="1" height="37" border="0" alt="" /></td> </tr> <tr> <td colspan="4" align="center" valign="top" background="images/template.slice.18.png" style="vertical-align:top;"><p class="standard"> </p> <table width="80%" border="0"> <tr> <td colspan="2"> <?php if($messages){ //displayErrors($messages); } else { //echo("<p align=\"center\" class=\"standard\">Your account has been activated.</p><p align=\"center\" class=\"standard\">You now need to change your password. If you like you can also change your username, Remember that you only have 3 days to do so and this change will be permanent.</p>"); ?></td> </tr> <form name="ChangeDetails" method="post" action="<?=$_SERVER['PHP_SELF']?>"> <input type="hidden" name="activationid" value="<?php if($_GET['id']){ $id=$_GET['id']; echo($id); } elseif($_POST['activationid']){ $id=$_POST['activationid']; echo($id); } else { die("No ID") } ?>" /> <tr> <td width="50%"><div align="right" class="standard">New Username: </div></td> <td width="50%"><input name="login" type="text" id="login" size="35" maxlength="30" /></td> </tr> <tr> <td><div align="right" class="standard">New Password:</div></td> <td><input name="password" type="password" id="password" size="35" maxlength="30" /></td> </tr> <tr> <td><div align="right" class="standard">Re-enter password:</div></td> <td><input name="passwordc" type="password" id="passwordc" size="35" maxlength="30" /></td> </tr> <tr> <td><div align="right" class="standard">Please enter the code: </div></td> <td> <?php require_once('recaptchalib.php'); $publickey = "6Le4fsESAAAAAKMOHb8aaiyDfGRJyr0y0EU7dXm-"; // you got this from the signup page echo recaptcha_get_html($publickey); ?> </td> </tr> <tr> <td> </td> <td><input type="submit" name="submit" id="submit" value="Change your details" /></td> </tr> </form> </table> </td> <td><img src="images/spacer.gif" width="1" height="450" border="0" alt="" /></td> </tr> <tr> <td colspan="4" background="images/template.slice.19.png"> </td> <td><img src="images/spacer.gif" width="1" height="50" border="0" alt="" /></td> </tr> <tr> <td colspan="9" background="images/template.slice.20.png"> </td> <td><img src="images/spacer.gif" width="1" height="40" border="0" alt="" /></td> </tr> </table> </div> </body> </html> <?php } ?> Thanks to all you kind people that take your time to read and help me with this problem. I'm sorry if it is a really simple problem I missed out that makes me look like a right idiot and wasted your time, but that's me I'm always missing stuff out like that, I do proof read though just sometimes not good enough. Thanks in advance! Hi all, I'm looking for some help in parsing an XML file from geocaching.com. It's pretty far beyond me as I've never tried parsing XML like using PHP before (although I'm OK at PHP in a general sense). Ideally I'm looking to be able to query every element in this file (attached, renamed to .txt - was originally .gpx) so that I can do stuff with it. I don't need to update the file, just read it and create a UI from the contents. Should I use SimpleXMLElement, xml_parser or something else? The structure of the file isn't something I've encountered before because of the <groundspeak:log> formatted elements. I'm only used to relatively simple XML files with the colon-separate bits. Can anyone help? Thanks! Code: [Select] <?php mysql_connect ("-","-","-") or die ('Error'); mysql_select_db ("-"); $out = mysql_query("SELECT * FROM guestbook ORDER BY id DESC"); while($row = mysql_fetch_assoc($out); --and this one if that braces is deleted { ----this is where im getting the error $name = $row['name']; $email = $row['email']; $txt = $row['comment']; $msg = "Are you sure you want to delete"; /* @var $_REQUEST <type> */ if (isset($_REQUEST ["action"]) && $_REQUEST["action"] == "del") { $id = intval($_REQUEST['id']); mysql_query("DELETE FROM guestbook WHERE id=$id;"); echo "<action=index.php>"; } echo "<font face='verdana' size='1'>"; echo "<table border='0'> <tr><td>Name: ".$name."</td></tr>"." <tr><td>Email: ".$email."</td></tr> <tr><td colspan='2'>Comment:</td></tr> <tr><td colspan='2' width='500'><b>".$txt."</b></td></tr> <tr><td><a onclick=\"return confirm('.$msg.');\" href='index.php?action=del&id=".$row['id']."'><span class='red'>["."Delete"."]</span></a> </td></tr> </table><br />"; echo "<hr size='1' width='500' align='left'></font>"; } ?> Kindly help me please. When i delete ({) the error will become the ( i dont know what to do already. Thanks. Hi folks, I am a complete n00b at php and mysql. I am teaching myself from books and the WWW, but alas I am stuck... the error I get is: Parse error: syntax error, unexpected T_STRING in X:\xampp\htdocs\search.php on line 7 here is the code: <?php mysql_connect ("localhost", "user", "password") or die (mysql_error()); mysql_select_db ("it_homehelp_test") or die (mysql_error()); $term = $_POST['term']; $sql = $mysql_query(select * from it_homehelp_test where ClientName1 like '%term%'); <<<------this is line 7 while ($row = mysql_fetch_array($sql)){ echo 'Client Name:' .$row['ClientName1']; echo 'Address:' .$row['Address1']; echo 'Phone:' .$row['Tel1']; } ?> Any help you can offer would be great. I can also post the ".html" file that creates the search bar if it is needed. Thanks I don`t get it, waht is wrong?! Code: [Select] <?php require_once 'auth.php'; if (!isset($_SESSION['SESS_VERIFY'])) { header("location: access-denied.php"); exit(); } if ($_SESSION['lang'] == 'Ro') { // setare data romania date_default_timezone_set('Europe/Bucharest'); $today = getdate(); $zi = $today['mday']; $luna = $today['mon']; $lunastring = $today['month']; $an = $today['year']; $data = $zi.$luna.$an; $data = (string)$data; $ora = date('H:i:s'); $msg = array(); $err = array(); $luni = array ( 1=>'Ianuarie', 2=>'Februarie', 3=>'Martie', 4=>'Aprilie', 5=>'Mai', 6=>'Iunie', 7=>'Iulie', 8=>'August', 9=>'Septembrie', 10=>'Octobrie', 11=>'Noiembrie', 12=>'Decembrie'); // comun const SQL_ERR = 'SQL statement failed with error: '; const ADD_MODEL = 'ADAUGA UN MODEL NOU'; . .many constants.. . } elseif ($_SESSION['lang'] == 'It') {... Thank you! I just enabled error reporting and I am not that familiar with it. I know I have an error some where around line 33. I know I am missing a bracket or a comma or some other syntax error I just cannot find where the error is. Below is my script. Thanks for any help. 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"> <head> <title>Airline Survey</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <meta name="author" content="Revised by abc1234"/> </head> <body> <?php $WaitTime = addslashes($_POST["wait_time"]); $Friendliness = addslashes($_POST["friendliness"]); $Space = addslashes($_POST["space"]); $Comfort = addslashes($_POST["comfort"]); $Cleanliness = addslashes($_POST["cleanliness"]); $Noise = addslashes($_POST["noise"]); if (empty($WaitTime) || empty($Friendliness) || empty($Space) || empty($Comfort) || empty($Cleanliness) || empty($Noise)) echo "<hr /><p>You must enter a value in each field. Click your browser's Back button to return to the form.</p><hr />"; else { $Entry = $WaitTime . "\n"; $Entry .= $Friendliness . "\n"; $Entry .= $Space . "\n"; $Entry .= $Comfort . "\n"; $Entry .= $Cleanliness . "\n"; $Entry .= $Noise . "\n"; $SurveyFile = fopen("survey.txt", "w") } if (flock($SurveyFile, LOCK_EX)) { if (fwrite($SurveyFile, $Entry) > 0) { echo "<p>The entry has been successfully added.</p>"; flock($SurveyFile, LOCK_UN; fclose($SurveyFile); else echo "<p>The entry could not be saved!</p>"; } else echo "<p>The entry could not be saved!</p>"; } ?d> <p><a href="AirlineSurvey.html">Return to Airline Survey</a></p> </body> </html>
Hello everyone,
1 <?php
7 // Create connection
10 // Check connection
14 $firstname = $conn->real_escape_string($_REQUEST['firstname']); 25 $sql2 = "INSERT INTO countries VALUES ('$country')"; 27 $sql3 = "INSERT INTO Contacts (firstname, lastname, address, city, country, phone, email) VALUES ('$firstname', '$lastname', '$address', $city, $country, '$phone_number','$email')";
29 SELECT * FROM cities;
if($conn->query($sql2) === true){
if($conn->query($sql3) === true){ |