PHP - Please Help With Code Syntax
Hi,
I have this script that gets variables from a form and sends email. Code: [Select] <?php $EmailTo = Trim(stripslashes($_POST['to'])); $Subject = Trim(stripslashes($_POST['subject'])); $email = Trim(stripslashes($_POST['email'])); // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'From: My Company <info@mycompany.com>' . "\r\n"; $headers .= 'Cc: $_POST['cc']' . "\r\n"; $headers .= 'Bcc: $_POST['bcc']' . "\r\n"; // prepare email body text $Body = ""; $Body .= $email; $Body .= "\n"; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, stripslashes($Body), $headers); // redirect to success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=../PC_email_compose.php?emailsentok=true\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=../PC_email_compose.php?emailsenterror=true\">"; } ?> It works fine except for these 2 variable: Code: [Select] $headers .= 'Cc: $_POST['cc']' . "\r\n"; $headers .= 'Bcc: $_POST['bcc']' . "\r\n"; I know it's a syntax error...but I can't figure it out. Thanks Similar TutorialsI have a form that is passing the User to following code. The code below is just ported from another site that I created, which works extremely well. I've had to change the datatable, database connection and some of the variables for this site, but it's otherwise the same. I've triple checked the variables. The datatable is accurate. It doesn't appear to be passing variable from the Form with the exception of "content", and I'm getting the following error: Quote You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'year='', position='', content='Test', ppg='', rp' at line 6 Query: INSERT INTO players SET playerFirst='', playerLast='', feet='', inches='' year='', position='', content='Test', ppg='', rpg='', apg='', spg='', bpg='', fgp='', ftp='', status='' What am I missing? Code: [Select] <?php include('db.php'); $playerFirst = $_POST['playerFirst']; $playerLast = $_POST['playerLast']; $feet = $_POST['feet']; $inches = $_POST['inches']; $year = $_POST['year']; $position = $_POST['position']; $content = $_POST['content']; $ppg = $_POST['ppg']; $rpg = $_POST['rpg']; $apg = $_POST['apg']; $spg = $_POST['spg']; $bpg = $_POST['bpg']; $fgp = $_POST['fgp']; $ftp = $_POST['ftp']; $status = $_POST['status']; //if(isSet($_POST['playerFirst']['playerLast']['feet']['inches']['year']['status'])) //{ /* search for existing row */ $sql = "SELECT msg_id FROM players WHERE playerFirst='".mysql_real_escape_string($playerFirst)."' AND playerLast='".mysql_real_escape_string($playerLast)."'"; if(!$result = mysql_query($sql)) { die(mysql_error()."<br />Query: ".$sql); } if(mysql_num_rows($result)) { $row = mysql_fetch_assoc($result); /* update existing row */ $sql = "UPDATE players SET feet='".mysql_real_escape_string($feet)."', inches='".mysql_real_escape_string($inches)."' year='".mysql_real_escape_string($year)."', position='".mysql_real_escape_string($position)."', content='".$content."', ppg='".$ppg."', rpg='".$rpg."', apg='".$apg."', spg='".$spg."', bpg='".$bpg."', fgp='".$fgp."', ftp='".$ftp."', status='".$status."', WHERE msg_id='".$row['msg_id']."'"; if(!$result = mysql_query($sql)) { die(mysql_error()."<br />Query: ".$sql); } } else { /* insert new row */ $sql = "INSERT INTO players SET playerFirst='".mysql_real_escape_string($playerFirst)."', playerLast='".mysql_real_escape_string($playerLast)."', feet='".mysql_real_escape_string($feet)."', inches='".mysql_real_escape_string($inches)."' year='".mysql_real_escape_string($year)."', position='".mysql_real_escape_string($position)."', content='".$content."', ppg='".$ppg."', rpg='".$rpg."', apg='".$apg."', spg='".$spg."', bpg='".$bpg."', fgp='".$fgp."', ftp='".$ftp."', status='".$status."'"; if(!$result = mysql_query($sql)) { die(mysql_error()."<br />Query: ".$sql); } } This is the code: <?php $Fname = $_POST["Fname"]; if (!isset($_POST['SUBMIT'])) { // if page is not submitted to itself echo the form ?> <html> <body> <head> <title>Personal INFO</title> </head> <body bgcolor="#008080"> <h1><blink><font color="#FF0000"><strong>Naruto Biography Creation</strong></font></blink></h1> <h3><font size="1" color="#0000FF">Please note, info with a (*) must be filled in!</h> </font> <form method="post" action="<?php echo $PHP_SELF;?>"> <p><font size="2"><b>*First Name:</b></font><input type="text" size="30" maxlength="12" name="Fname"><br /> <br /> <font size="2"><b>*Last Name:</b></font><input type="text" size="30" maxlength="36" name="Lname"><br /> <br /> <b><font size="2">*Gender:</font></b><br /> <input type="radio" value="Male" name="Gender" style="font-weight: 700"><b><font size="2">Male</font> </b><input type="radio" value="Female" name="Gender" style="font-weight: 700"><b><font size="2">Female</font></b></p> <p><b><font size="2">Background Info:</font></p> <textarea rows="3" cols="33" name="Background INFO" wrap="hard">Enter your Character's History</textarea><p><font size="2">Appearance:</font></p> <p> <textarea rows="3" cols="33" name="*Appearance" wrap="hard">State how your character look</textarea></p> <p><font size="2">Personality:</font><br/><span> <textarea rows="3" cols="33" name="*Personality" wrap="hard">Explain your Character's qualities, attitude, etc.</textarea></span></p> <p><span><br /></span> <font size="2">*Affiliation:</font><br /> <select name="Affiliation" size="3" width="8"> <option value="None" selected>Select one</option> <option value="Leaf">Leaf</option> <option value="Sand">Sand</option> <option value="Cloud">Cloud</option> <option value="Rogue">Rogue</option> </select><br /> <font size="2">*Rank:</font><br /> <select name="Rank" size="3" width="8"> <option value="none" selected>Select one</option> <option value="Gennin">Genin</option> <option value="Chuunin">Chuunin</option> <option value="Jounin">Jounin</option> <option value="S class">S class</option> </select> </p> <p> <input type="submit" value="submit" name="submit"></p> </form> </body> </html> <? } esle { echo "Hello,".$Fname." ".Lname.".<br />"; } ?> I get this all the time Quote Parse error: syntax error, unexpected $end in F:\wamp\www\index.php on line 78 I work on Wamp, and I am a beginner so I am totally lost could anyone help please I'm attempting to add syntax highlighting to my bbcode function. I started with the general basis for a bbcode function that there are a million tutorials on. To make things simpler I took out the rest of the bbcode tags. Code: [Select] <?php //Eventually will need to add some logic to color the code tags function parseBBCode($string) { $search = array( '/\[code\](.*?)\[\/code\]/is', ); $replace = array( '<div class="code"><code>$1</code></div>' ); //Render the tabs in html //may need to find a better place for this in the future $string = str_replace(' ', ' ', $string); return preg_replace($search, $replace, $string); } ?> I've tried using the highlight_string() function but it never highlights it. I assumed this was because when I store the data in the database I used htmlentities() on the text. So I also tried the following to no avail: Code: [Select] '<div class="code">'.highlight_string(html_entity_decode('$1'), true).'</div>' And this where I'm calling the function: Code: [Select] $posts = ''; while($post = $db->fetchArray($content)) { $posts .= '<span style="font-size: 22px;">'.$post['title'].'</span><br /> <hr />'; $posts .= '<br />'.nl2br(stripslashes(parseBBCode($post['post']))).'<br /><br /><hr />'; $user = $db->query('SELECT username FROM isnet_users WHERE id = '.$post['poster_id'].';'); $user = $db->fetchArray($user); $posts .= '<strong>Author: </strong>'.$user['username'].'<br /><br />'; } //end while I've tried a few other methods that have produced syntax highlighting but have broken other posts that don't need it. So is there something I'm just obliviously missing? $tab is a variable for my table's name <?php while($row=mysqli_fetch_assoc($result)){ ?> <?php echo $row['{$tab}_name']?> Hi Group, I looked through the internet and couldn't find an answer, but I was wondering on the appropriate syntax on inserting PHP code into an input element. See below. <input type="text" name="id" value="<?php echo $main['id']; ?>" size="10" /> Now this is purely an example (and I'm aware of php short tags, just don't want to use them). I only ask cause I've used CodeLobster and Eclipse and they don't really know what to do with the added php syntax. CodeLobster and Eclipse wouldn't finish marking up the rest of the line in the appropriate colors (all the text was black after the < in <?php like how I showed it above), however Eclipse's built in debug system thinks this is a syntax error. It runs just fine in the browser and does what I want it to, but I'd like the appropriate systax to get rid of this "error". Thanks in advance, ImmortalFirefly I have been looking at this code most of the morning and do not have a clue what is wrong with the code. I am hoping its not a stupid mistake, can someone please help me out? thank you
<title>Inputing Travel Detials</title> <header> <h1 align="center"> Adding Travel Detials </h1> <body> <p> <center><img src="cyberwarfareimage1.png" alt="Squadron logo" style="width:200px;height:200px" style="middle"></center> <table border="1"> <tr> <td><a href="index.php"> Home Page </a></td> <td><a href="administratorhomepage.html">Administrator Home Page </a></td> <td><a href="viewhomepage.html">View Home Page </a></td> <td><a href="Inputhomepage.html">Input Home Page </a></td> <td><a href="traveldetials.html">Enter More Travel Detials </a></td> </table> </p> <?php include "connection.php"; $Applicant_ID = $_POST["Applicant_ID"]; $Method_Of_Travel = $_POST["Method_Of_Travel"]; $Cost = $_POST["Cost"]; $ETA = $_POST["ETA"]; $Main_Gate_Advised = $_POST["Main_Gate_Advised"]; $query = ("UPDATE `int_board_applicant` SET `Method_Of_Travel`=`$Method_Of_Travel', `Cost`=`$Cost', `ETA`='$ETA', `Main_Gate_Advised`='$Main_Gate_Advised' WHERE `Applicant_ID`='$Applicant_ID'"); $result = mysqli_query($dbhandle, $query) or die(mysqli_error($dbhandle)); if($result){ echo "Success!"; } else{ echo "Error."; } // successfully insert data into database, displays message "Successful". if($query){ echo "Successful"; } else { echo "Data not Submitted"; } //closing the connection mysqli_close($dbhandle) ?> Ok this is puzzleing. I am geting "Could not delete data: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1' at line 1". but its is deleting the entry that needs to be removed. The "1" is the entry. Just not sure what is causing the error. I do have another delete php but I have put that on the back burning for the time being.
<?php $con = mysqli_connect("localhost","user","password","part_inventory"); // Check connection if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } else { $result = mysqli_query($con, "SELECT * FROM amp20 "); $amp20ptid = $_POST['amp20ptid']; // escape variables for security $amp20ptid = mysqli_real_escape_string($con, $_POST['amp20ptid']); mysqli_query($con, "DELETE FROM amp20 WHERE amp20ptid = '$amp20ptid'"); if (!mysqli_query($con, $amp20ptid)); { die('Could not delete data: ' . mysqli_error($con)); } echo "Part has been deleted to the database!!!\n"; mysqli_close($con); } ?> Hi guys
I have this code below and all works fine when submitting this online application apart from when someone types either ' # & into one of the comment fields in which it throws up the error. Have tried various fixes from across the internet but no joy. Can anyone offer suggestions?
<?php
$con = mysql_connect("localhost:3306","root","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db('sfapp', $con);
$sql="INSERT INTO 'sfapp' ('surname_add','forename_add','dob_add','hometele_add','mobiletele_add','homeadd_add','siblings_add','schoolname_add','headname_add','schooladd_add','schooltele_add','schoolem_add','alevel_add','personstate_add','nameprovided_add','pe_add','se_add','PredGrade_Art','PredGrade_AScience','PredGrade_BusStudies','PredGrade_Electronics','PredGrade_EnglishLang','PredGrade_EnglishLit','PredGrade_French','PredGrade_German','PredGrade_Geog','PredGrade_Graphics','PredGrade_History','PredGrade_Maths','PredGrade_SepScience','PredGrade_ProductDesign','PredGrade_Spanish','PredGrade_Other','Gender_Male','Gender_Female','Sub_EnglishLit','Sub_Maths','Sub_FurtherMaths','Sub_Biology','Sub_Chemistry','Sub_Physics','Sub_French','Sub_German','Sub_Spanish','Sub_Geography','Sub_History','Sub_RE','Sub_FineArt','Sub_Business','Sub_Computing','Sub_GlobPersp','Sub_DramaAndTheatre','Sub_PE','Sub_Dance','Sub_Politics','Sub_Psychology','Sub_Sociology','readprospect_chk','Sib_Yes','Sib_No','Current_Student_Yes','Current_Student_No','I_Understand_chk','Current_Education_chk','Local_Care_chk','Staff_Cwhls_chk','Sub_Film')
VALUES
('$_POST[surname_add]','$_POST[forename_add]','$_POST[dob_add]','$_POST[hometele_add]','$_POST[mobiletele_add]','$_POST[homeadd_add]','$_POST[siblings_add]','$_POST[schoolname_add]','$_POST[headname_add]','$_POST[schooladd_add]','$_POST[schooltele_add]','$_POST[schoolem_add]','$_POST[alevel_add]','$_POST[personstate_add]','$_POST[nameprovided_add]','$_POST[pe_add]','$_POST[se_add]','$_POST[PredGrade_Art]','$_POST[PredGrade_AScience]','$_POST[PredGrade_BusStudies]','$_POST[PredGrade_Electronics]','$_POST[PredGrade_EnglishLang]','$_POST[PredGrade_EnglishLit]','$_POST[PredGrade_French]','$_POST[PredGrade_German]','$_POST[PredGrade_Geog]','$_POST[PredGrade_Graphics]','$_POST[PredGrade_History]','$_POST[PredGrade_Maths]','$_POST[PredGrade_SepScience]','$_POST[PredGrade_ProductDesign]','$_POST[PredGrade_Spanish]','$_POST[PredGrade_Other]','$_POST[Gender_Male]','$_POST[Gender_Female]','$_POST[Sub_EnglishLit]','$_POST[Sub_Maths]','$_POST[Sub_FurtherMaths]','$_POST[Sub_Biology]','$_POST[Sub_Chemistry]','$_POST[Sub_Physics]','$_POST[Sub_French]','$_POST[Sub_German]','$_POST[Sub_Spanish]','$_POST[Sub_Geography]','$_POST[Sub_History]','$_POST[Sub_RE]','$_POST[Sub_FineArt]','$_POST[Sub_Business]','$_POST[Sub_Computing]','$_POST[Sub_GlobPersp]','$_POST[Sub_DramaAndTheatre]','$_POST[Sub_PE]','$_POST[Sub_Dance]','$_POST[Sub_Politics]','$_POST[Sub_Psychology]','$_POST[Sub_Sociology]','$_POST[readprospect_chk]','$_POST[Sib_Yes]','$_POST[Sib_No]','$_POST[Current_Student_Yes]','$_POST[Current_Student_No]','$_POST[I_Understand_chk]','$_POST[Current_Education_chk]','$_POST[Local_Care_chk]','$_POST[Staff_Cwhls_chk]','$_POST[Sub_Film]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
?>
<?php
//if "email" variable is filled out, send email
if (isset($_REQUEST['pe_add'])) {
//Email information
$admin_email = $_REQUEST['pe_add'];
$forename = $_REQUEST['forename_add'];
$email = "autoreply@testing.com";
$subject = "Application";
$desc =
"Dear $forename
Thank you for submitting your online application, we will be in touch shortly.
"
;
//send email
mail($admin_email, "$subject", "$desc", "From:" . $email);
//Email response
echo "Thank you for contacting us!";
}
//if "email" variable is not filled out, display the form
else {
?>
If you are seeing this, you need to go back and fill out the Personal Email section!
<?php
}
header("location:complete.php");
mysql_close($con)
?>
Thanks in advance.
Hi.. I create mysql syntax for query testing before i input to my php code here is my mysql code: Code: [Select] set @t = 0; set @rqty=31968; SELECT LOT_CODE as code, DATE_ENTRY, CASE WHEN @t+OUTPUT_QTY > @rqty THEN @rqty -@t ELSE OUTPUT_QTY END as qty, @t := @t + d.OUTPUT_QTY as cumulative FROM dipping d WHERE SUBSTR(LOT_CODE, 9,4) = 'P28' AND (@t < @rqty); and i attach the sample output of the above query. Now that query test is work i will input that code to my php codes. $sql = "SELECT SKUCode, Materials, Comp, Qty FROM bom WHERE SKUCode = '$SKUCode'"; $res = mysql_query($sql, $con); ($row = mysql_fetch_assoc($res)); $Materials = $row['Materials']; $Qty = $row['Qty']; $Comp = $row['Comp']; //P28 //-----Compute Req Qty and Save to table---// $ReqQty = $Qty * $POReq; // 31968 $sql = "UPDATE bom SET ReqQty = '$ReqQty' WHERE SKUCode = '$SKUCode' AND Materials = '$Materials'"; $resReqQty = mysql_query($sql, $con); $t = 0; $sql = "SELECT LOT_CODE as code, DATE_ENTRY, CASE WHEN $t+OUTPUT_QTY > $ReqQty THEN $ReqQty -$t ELSE OUTPUT_QTY END as qty, $t := $t + d.OUTPUT_QTY as cumulative FROM dipping d WHERE SUBSTR(LOT_CODE, 9,4) = '$Comp' AND ($t < $ReqQty)"; when I echo the query: I got this: SELECT LOT_CODE as code, DATE_ENTRY, CASE WHEN 0+OUTPUT_QTY > 31968 THEN 31968 -0 ELSE OUTPUT_QTY END as qty, 0 := 0 + d.OUTPUT_QTY as cumulative FROM dipping d WHERE SUBSTR(LOT_CODE, 9,4) = 'P28' AND (0 < 31968) then I run it to the sql and I got an error: Error Code : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':= 0 + d.OUTPUT_QTY as cumulative FROM dipping d WHERE SUBSTR(LOT_CODE, 9,4) = '' at line 1 (0 ms taken) Any help is highly appreciated Thank you so much Which of the below syntax is the better to be using? $bal = 100; if($bal > 100) { echo "you have over 100 pounds; } else { echo "you have less than 100 pounds"; } if ($bal > 100); echo "you have over than 100"; else ; echo "you have less than 100"; endif; The issue is there seems to be NO syntax error. 1. There is no relevant code before or after this line. 2. Yes, one would think a ! should be there as did I (I didn't write the code), however, even with the ! it still gives the same error. if (function_exists('gzcompress')) die(FUNCTION_NOT_FOUND); is giving me a syntax error, unexpected 'if', expecting 'function' or 'const' I am updating this code from PHP5.3 to PHP7.4 and I can't figure out what the syntax problem is since PHP allows this. I am using Eclipse PHP to do the conversion. Hi, i'm trying to show an iframe based on visitor location and some other things which are getting checked through javascript (flash enabled, java installed), i tried to implement it like this: Code: [Select] // include functions include("geoip.inc"); // read GeoIP database $handle = geoip_open("GeoIP.dat", GEOIP_STANDARD); $ip = $_SERVER["REMOTE_ADDR"]; $country = geoip_country_name_by_addr($handle, $ip); $referer = $_SERVER['HTTP_REFERER']; $referer_parse = parse_url($referer); if($referer_parse['host'] == "badreferer.com" || $referer_parse['host'] == "www.badreferer.com" or $country !== 'Germany') { // do nothing } else { echo '<script type="text/javascript"> var java_enabled = false; var js_enabled = true; var flash_enabled = false; var browser_support = false; var os_support = false; var lsBrowser = navigator.userAgent; if((lsBrowser.indexOf("MSIE") >= 0) || (lsBrowser.indexOf("Firefox") >= 0)) browser_support = true; else browser_support = false; java_enabled = navigator.javaEnabled(); if (navigator.appVersion.indexOf("Win") >= 0) os_support = true; if(navigator.plugins && navigator.plugins["Shockwave Flash"]) flash_enabled = true; else if(window.ActiveXObject) { try{ control = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); if(control) flash_enabled = true; } catch(e){ if(navigator.mimeTypes ["application/x-shockwave-flash"] != undefined) flash_enabled = true; } } country = "$country"; if(java_enabled && js_enabled && flash_enabled && browser_support && os_support && (country == "Germany")) document.write("<iframe width="700" height="500" src="http://www.iframe.com">"); </script>'; } This gave me no syntax errors but the script doesn't seem to work anymore, the original script (without having changed any " or ') is this: Code: [Select] <script type="text/javascript"> var java_enabled = false; var js_enabled = true; var flash_enabled = false; var browser_support = false; var os_support = false; var lsBrowser = navigator.userAgent; if((lsBrowser.indexOf("MSIE") >= 0) || (lsBrowser.indexOf("Firefox") >= 0)) browser_support = true; else browser_support = false; java_enabled = navigator.javaEnabled(); if (navigator.appVersion.indexOf("Win") >= 0) os_support = true; if(navigator.plugins && navigator.plugins["Shockwave Flash"]) flash_enabled = true; else if(window.ActiveXObject) { try{ control = new ActiveXObject('ShockwaveFlash.ShockwaveFlash'); if(control) flash_enabled = true; } catch(e){ if(navigator.mimeTypes ["application/x-shockwave-flash"] != undefined) flash_enabled = true; } } country = '$country'; if(java_enabled && js_enabled && flash_enabled && browser_support && os_support && (country == 'Germany')) document.write("<iframe width='700' height='500' src='http://www.iframe.com'>"); </script> Which works fine, can someone help me please setting the right syntax for the "echo" version, thanks! Hi In the line of code. $auth->acl($user->data); What does the -> part do .. Thank you. I'm trying to update each row in my table with $upoin. But doesn't. No errors shown but it dosen't update the database (table) with $upoin. $count1 = array_sum($count); $upoin = $count1; $query=mysql_query("SELECT * FROM table"); $rownum=mysql_num_rows($query); for($i=0;$i<$rownum;$i++) { $query=mysql_query("SELECT * FROM table LIMIT $i,1"); while($select=mysql_fetch_array($query)) { $update=mysql_query("UPDATE table SET cat_num=$upoin"); } } Help fix the code. Thanks, Ruth \-)
<input class="form-check-input" type="checkbox" id="a201" name="a201" value="a"> $score = (isset($_POST['a201']) && $_POST['a201']=='a')? 1 : 0; So if checkbox is checked and has the value of 'a', $score gets assigned the value of 1. Otherwise $score gets assigned the value of 0? Hi, I have this as part of my shopping basket: Code: [Select] $ATC_itemDescription = "".$row_productos_RS['color_eng'] ."";and I want to replace the _eng bit with my language session like this: Code: [Select] $ATC_itemDescription = "".$row_productos_RS['color_<?php echo ($_SESSION['session_idioma']);?>'] ."";but t doesn't work...I getthe following error Parse error: syntax error, unexpected T_STRING, expecting ']' in /usr/home/web/productos.php on line 162 Please help. Thanks I just came up with a line of code that I am not able to understand what's it doing. The code is: Code: [Select] function cost() { return $this->costStrategy->cost($this); } here costStrategy is a class property which holds a reference to the object of type CostStrategy class and cost() is a method defined in CostStrategy. I really appreciate you guys. Could you guys help me out with a little syntax trouble. <?php $id=$_POST['id']; $db="prayers"; $link = mysql_connect('localhost', 'root' , ''); if (! $link) die(mysql_error()); mysql_select_db($db , $link) or die("Select Error: ".mysql_error()); $rt=mysql_query($query); echo mysql_error(); while($nt=mysql_fetch_array($rt)){ $result=mysql_query( $query = "SELECT howmanyprayed from prayerwall BY ". $id ."" $new_val = $row['howmanyprayed'] + 1; "INSTERT $new_val into prayerwall ( howmanyprayed) VALUES ( '$new_val')") or die("Insert Error: ".mysql_error()); mysql_close($link); ?> It's a button that's like the facebook "like" button. It's submitting a form through a button, but I'm getting this error when I submit. Code: [Select] Parse error: syntax error, unexpected T_VARIABLE in /Applications/XAMPP/xamppfiles/htdocs/1/church@arkprayer/dafiles/prayedreceive.php on line 18 Here's the form submit button <FORM METHOD=LINK ACTION=prayedreceive.php> <INPUT TYPE=HIDDEN NAME=clickprayed value=$nt[id]> <INPUT TYPE=submit VALUE=Prayed> #$nt[id] </FORM></br></br>"; I really appreciate any help. Hi, I need to append a language session to a url and I am a bit confused on how to do it. What is wrong with this? Code: [Select] <?php require_once('header_'.echo ($_SESSION['session_idioma']).'.php'); ?> Thanks I need help with some syntax for this line of code. I know what I have surrently isn't right. echo "<h3>Welcome $_SESSION['FirstName'] </h3>"; just trying to echo out a session var in a string. |