forumnz Posted January 2, 2007 Share Posted January 2, 2007 I get this error when trying to execute my script: Parse error: syntax error, unexpected $end in /usr/local/psa/home/vhosts/sitename.com/httpdocs/thing/area/edit.php on line 113Heres the code:[code]<?php session_start(); $con = mysql_connect("localhost","****","*****");if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("my_db", $con); $valid = false; if( isset($_SESSION['userid']) ) { //do whatever appropriate validation is necessary on id //if we encounter errors abort? $id = $_SESSION['userid']; //No errors... proceed //connect to database $query = "SELECT email FROM members WHERE id = '$id'";//echo $query; $result = mysql_query($query); if( mysql_errno() ){ echo "\n\nERROR: " . mysql_error();} $row = mysql_fetch_row($result); $email = ""; if( $row ) { $valid = true; $email = $row[0];//echo "EMAIL: $email";";";//echo area $query; $result = mysql_query($query); if( mysql_errno() ){//echo "\n\nERROR: " . mysql_error();} $row = mysql_fetch_row($result); $area = ""; if( $row ) { $valid = true; $area = $row[0];//echo "Area: $area";";"; } else { //Invalid username... handle error appropriately $valid = false; } //disconnect from database } else { //ERROR - Not logged in.... //Redirect to login page? $valid = false; } if( !$valid ) { //Errors, redirect.... }?><!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=iso-8859-1" /><title>Untitled Document</title></head><body><p>Edit Profile</p><form id="form1" name="form1" method="post" action="edit.php"><p>Password : <input name="password" type="text" id="password" /> <br /> Confirm Password : <input name="password" type="text" id="password" /></p><p>Email Address : <?php echo "<input name=\"email\" type=\"text\" id=\"email\" value=\"$email\" />\n"; ?></p><p>Area : <?php echo "<input name=\"area\" type=\"text\" id=\"area\" value=\"$area\" />\n"; ?></p><p> <label> <input type="submit" name="Submit" value="Go!" /> </label></p></form><p> </p></body></html>[/code] Link to comment https://forums.phpfreaks.com/topic/32539-i-got-an-error/ Share on other sites More sharing options...
vpnprgm Posted January 2, 2007 Share Posted January 2, 2007 hi,In this partif( isset($_SESSION['userid']) ) {this open brace not closed.pls check that.I think that was your problemRegardsVijay Link to comment https://forums.phpfreaks.com/topic/32539-i-got-an-error/#findComment-151302 Share on other sites More sharing options...
forumnz Posted January 2, 2007 Author Share Posted January 2, 2007 No thats not it... it closes at the end of the php part ?> Link to comment https://forums.phpfreaks.com/topic/32539-i-got-an-error/#findComment-151303 Share on other sites More sharing options...
kam_uoc Posted January 2, 2007 Share Posted January 2, 2007 check the 13th line of your code. if closure didnt closed. close it and try. Link to comment https://forums.phpfreaks.com/topic/32539-i-got-an-error/#findComment-151305 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.