franknu Posted November 22, 2006 Share Posted November 22, 2006 can anyone help me out here, i am getting a parser error in my member page i dont see why i am getting it maybe someone can tell me whyhere is the code:[code=php:0]<?php$host = "localhost";$username = "localhost";$password = "abc123";$database = "contacts";$db = mysql_connect($host, $username, $password) or die(mysql_error()); mysql_select_db($database) or die(mysql_error()); $BusinessName = (isset($_GET['BusinessName']) ? $_GET['BusinessName'] : ''); $Slogan = (isset($_GET['Slogan']) ? $_GET['Slogan']:'');$Business_Address = (isset($_GET['Business_Address']) ? $_GET['Business_Address']:'');$Tel = (isset($_GET['Tel']) ? $_GET['Tel']:'');$Website = (isset($_GET['Website']) ? $_GET['Website']:'');$Email = (isset($_GET['Email']) ? $_GET['Email']:'');$Member_Status = (isset($_GET['Member_Status']) ? $_GET['Member_Status']:'');$Fax =(isset($_GET['Fax']) ? $_GET['Fax']:'');$type = (isset($_GET['type']) ? $_GET['type']:'');$make = (isset($_GET['make']) ? $_GET['make']:'');$Categories = (isset($_GET['Categories']) ? $_GET['Categories']:'');$Keyword = (isset($_GET['Keyword']) ? $_GET['Keyword']:'');$Picture1 = (isset($_GET['Picture1']) ? $_GET['Picture1']:'');$Headline = (isset($_GET['Headline']) ? $_GET['Headline']:'');$Slogan2 = (isset($_GET['Slogan2']) ? $_GET['Slogan2']:'');$Description1 = (isset($_GET['Description1']) ? $_GET['Description1']:'');$Description2 = (isset($_GET['Description2']) ? $_GET['Description2']:'');$Description3= (isset($_GET['Description3']) ? $_GET['Description3']:'');$Contact2 = (isset($_GET['Contact2']) ? $_GET['Contact2']:'');$Picture2 = (isset($_GET['Picture2']) ? $_GET['Picture2']:'');$Picture3 = (isset($_GET['Picture3']) ? $_GET['Picture3']:'');$Picture4 = (isset($_GET['Picture4']) ? $_GET['Picture4']:'');$User_Name = (isset($_GET['User_Name']) ? $_GET['User_Name']:'');$Password = (isset($_GET['Password']) ? $_GET['Password']: '');$user = (isset($_POST['User_Name']) ? $_GET['User_Name']:'');if (isset($_POST['submit'])) { foreach ($_POST as $key => $val) { $$key = mysql_real_escape_string($val); } $q = "SELECT `Password` FROM business_info WHERE User_Name = '$User_Name'"; $sql = mysql_query($q) or die(mysql_error() . "<br />$q"); if (mysql_num_rows($sql) == 1) { $confPass = mysql_result($sql, 0, 'Password'); if ($Password == $confPass) { $query = "SELECT * FROM `business_info` WHERE `User_Name` ='$User_Name', AND `Password`='$Password',"}} echo "<table >"; echo "<tr>"; echo" <td valign='top'> "; echo" <table>"; echo "<tr> "; echo" <td>"; echo"Home"; echo"</td>"; echo"</tr>"; echo"<tr>"; echo"<td>"; echo"welcome $BusinessName"; echo"</td>"; echo"</tr>"; echo"</table>";v echo"<table>"; echo"<tr> "; echo"<td >"; echo"<table >"; echo "<tr> "; echo"<td>"; echo"Advertise your website"; echo"</td>"; echo"</tr>"; echo"<tr> "; echo"<td>"; echo"</td>"; echo"</tr>"; echo"<tr> "; echo"<td>"; echo"Email Marketin"; echo"</td>"; echo"</tr>"; echo"<tr> "; echo"<td>"; echo"Add An email "; echo"</td>"; echo"</tr>"; echo"<tr> "; echo"<td>"; echo"Messeges"; echo"</td>"; echo"</tr>"; echo"</table>"; echo"</td>"; echo"<td valign='top'> "; echo"<table>"; echo" <tr>"; echo"<td>"; echo"Update my site"; echo"</td>"; echo"<td>"; echo"Add Key words"; echo"</td>"; echo"<td>"; echo"CCBILL"; echo"</td>"; echo"</tr>"; echo"</table>"; echo"</td>"; echo"<td valign='top'>"; echo"</td>"; echo"</tr>"; echo"</table>"; echo"</td>"; echo"</tr>";echo"</table>"; } } else { // wrong user name and password echo "Wrong User Name and Password Try Again:"; }}?>[/code]my parser error : Parse error: parse error in c:\program files\easyphp1-8\home\townsfinder\authorization\update_page.php on line 65this is what i have on line 6562: if ($Password == $confPass)63: { 64 $query = "SELECT * FROM `business_info` WHERE `User_Name` ='$User_Name', AND `Password`='$Password',"65 echo "<table >";66 echo "<tr>"; Link to comment https://forums.phpfreaks.com/topic/28132-parser-error/ Share on other sites More sharing options...
mb81 Posted November 22, 2006 Share Posted November 22, 2006 You need a semicolon at the end of line 64. Link to comment https://forums.phpfreaks.com/topic/28132-parser-error/#findComment-128666 Share on other sites More sharing options...
franknu Posted November 22, 2006 Author Share Posted November 22, 2006 I made some changes to make it easy; but i am still gettin a parser error here is the code:<?php$host = "localhost";$username = "localhost";$password = "abc123";$database = "contacts";$db = mysql_connect($host, $username, $password) or die(mysql_error()); mysql_select_db($database) or die(mysql_error()); $User_Name= ($_POST['User_Name']);$Password=($_POST['Password']);if( User_Name=="$User_Name" || Password="$Password"){$query = "SELECT * FROM business_info WHERE `User_Name`== '$User_Name' AND `Password=='$Password'" ; $result = mysql_query($query) or die (mysql_error()); $row = mysql_fetch_assoc($result);$BusinessName= ($row['BusinessName']);$Keyword =($row['Keyword']); $Picture1 = ($row['Picture1']); $Headline = ($row['Headline']); $Slogan2 = ($row['Slogan2']); $Description1 =($row['Description1']); $Description2 = ($row['Description2']); $Description3= ($row['Description3']); $Contact2 = ($row['Contact2']); $Picture2 = ($row['Picture2']); $Picture3 = ($row['Picture3']); $Business_Address=($row['Business_Address']);$make=($row['make']);$type=($row['type']);$Tel=($row['Tel']);$Website=($row['Website']); echo "<table >"; echo "<tr>"; echo" <td valign='top'> "; echo" <table>"; echo "<tr> "; echo" <td>"; echo"Home"; echo"</td>"; echo"</tr>"; echo"<tr>"; echo"<td>"; echo"welcome $BusinessName"; echo"</td>"; echo"</tr>"; echo"</table>"; echo"<table>"; echo"<tr> "; echo"<td >"; echo"<table >"; echo "<tr> "; echo"<td>"; echo"Advertise your website"; echo"</td>"; echo"</tr>"; echo"<tr> "; echo"<td>"; echo"</td>"; echo"</tr>"; echo"<tr> "; echo"<td>"; echo"Email Marketin"; echo"</td>"; echo"</tr>"; echo"<tr> "; echo"<td>"; echo"Add An email "; echo"</td>"; echo"</tr>"; echo"<tr> "; echo"<td>"; echo"Messeges"; echo"</td>"; echo"</tr>"; echo"</table>"; echo"</td>"; echo"<td valign='top'> "; echo"<table>"; echo" <tr>"; echo"<td>"; echo"Update my site"; echo"</td>"; echo"<td>"; echo"Add Key words"; echo"</td>"; echo"<td>"; echo"CCBILL"; echo"</td>"; echo"</tr>"; echo"</table>"; echo"</td>"; echo"<td valign='top'>"; echo"</td>"; echo"</tr>"; echo"</table>"; echo"</td>"; echo"</tr>";echo"</table>"; } else { // wrong user name and password echo "Wrong User Name and Password Try Again:"; }?>My error say Parse error: parse error in c:\program files\easyphp1-8\home\townsfinder\authorization\update_page.php on line 22this is what i have on line 22 20.$User_Name= ($_POST['User_Name']);21.$Password=($_POST['Password']);22. if( User_Name=="$User_Name" || Password="$Password")23.{ Link to comment https://forums.phpfreaks.com/topic/28132-parser-error/#findComment-128774 Share on other sites More sharing options...
franknu Posted November 22, 2006 Author Share Posted November 22, 2006 I made some changes to make it easy; but i am still gettin a parser error here is the code:[code=php:0]<?php$host = "localhost";$username = "localhost";$password = "abc123";$database = "contacts";$db = mysql_connect($host, $username, $password) or die(mysql_error()); mysql_select_db($database) or die(mysql_error()); $User_Name= ($_POST['User_Name']);$Password=($_POST['Password']);if( User_Name=="$User_Name" || Password="$Password"){$query = "SELECT * FROM business_info WHERE `User_Name`== '$User_Name' AND `Password=='$Password'" ; $result = mysql_query($query) or die (mysql_error()); $row = mysql_fetch_assoc($result);$BusinessName= ($row['BusinessName']);$Keyword =($row['Keyword']); $Picture1 = ($row['Picture1']); $Headline = ($row['Headline']); $Slogan2 = ($row['Slogan2']); $Description1 =($row['Description1']); $Description2 = ($row['Description2']); $Description3= ($row['Description3']); $Contact2 = ($row['Contact2']); $Picture2 = ($row['Picture2']); $Picture3 = ($row['Picture3']); $Business_Address=($row['Business_Address']);$make=($row['make']);$type=($row['type']);$Tel=($row['Tel']);$Website=($row['Website']); echo "<table >"; echo "<tr>"; echo" <td valign='top'> "; echo" <table>"; echo "<tr> "; echo" <td>"; echo"Home"; echo"</td>"; echo"</tr>"; echo"<tr>"; echo"<td>"; echo"welcome $BusinessName"; echo"</td>"; echo"</tr>"; echo"</table>"; echo"<table>"; echo"<tr> "; echo"<td >"; echo"<table >"; echo "<tr> "; echo"<td>"; echo"Advertise your website"; echo"</td>"; echo"</tr>"; echo"<tr> "; echo"<td>"; echo"</td>"; echo"</tr>"; echo"<tr> "; echo"<td>"; echo"Email Marketin"; echo"</td>"; echo"</tr>"; echo"<tr> "; echo"<td>"; echo"Add An email "; echo"</td>"; echo"</tr>"; echo"<tr> "; echo"<td>"; echo"Messeges"; echo"</td>"; echo"</tr>"; echo"</table>"; echo"</td>"; echo"<td valign='top'> "; echo"<table>"; echo" <tr>"; echo"<td>"; echo"Update my site"; echo"</td>"; echo"<td>"; echo"Add Key words"; echo"</td>"; echo"<td>"; echo"CCBILL"; echo"</td>"; echo"</tr>"; echo"</table>"; echo"</td>"; echo"<td valign='top'>"; echo"</td>"; echo"</tr>"; echo"</table>"; echo"</td>"; echo"</tr>";echo"</table>"; } else { // wrong user name and password echo "Wrong User Name and Password Try Again:"; }?>[/code][code=php:0] My error say Parse error: parse error in c:\program files\easyphp1-8\home\townsfinder\authorization\update_page.php on line 22this is what i have on line 22 20.$User_Name= ($_POST['User_Name']);21.$Password=($_POST['Password']);22. if( User_Name=="$User_Name" || Password="$Password")[/code] Link to comment https://forums.phpfreaks.com/topic/28132-parser-error/#findComment-128776 Share on other sites More sharing options...
kenrbnsn Posted November 22, 2006 Share Posted November 22, 2006 Your line 22 is syntacally wrong. What are you attempting to compare?Do you want[code]<?phpif( $User_Name=="User_Name" || $Password=="Password")?>[/code]Ken Link to comment https://forums.phpfreaks.com/topic/28132-parser-error/#findComment-128781 Share on other sites More sharing options...
franknu Posted November 23, 2006 Author Share Posted November 23, 2006 well, i am trying to do is: if there is a user_name and password that match in the database display what isin the tables Link to comment https://forums.phpfreaks.com/topic/28132-parser-error/#findComment-128910 Share on other sites More sharing options...
franknu Posted November 23, 2006 Author Share Posted November 23, 2006 ok, now the problem that i am havin is that it is not going through the database,or tha what it seems like because whenever the user typed passward and user name it taken the to the end of the scriptsthis is the error display Link to comment https://forums.phpfreaks.com/topic/28132-parser-error/#findComment-128913 Share on other sites More sharing options...
garry27 Posted November 23, 2006 Share Posted November 23, 2006 you need to do something like this:[code] $email = ( $_GET['email'] ); $pwd = ( $_GET['pwd'] ); // validate login $sql = mysql_query("select * from Business_Info where User_Name='$userName' and User_Password='$pwd'"); $num_rows = mysql_num_rows($sql); if ($num_rows >0 ) { //a record exists and user is valid- but not validated } [/code]read up on sessions to find out how to validate users. Link to comment https://forums.phpfreaks.com/topic/28132-parser-error/#findComment-128920 Share on other sites More sharing options...
roopurt18 Posted November 23, 2006 Share Posted November 23, 2006 You can leave the parentheses off of statements like this:$Keyword =($row['Keyword']); You must always put $ in front of variable names.When posting your code, can you please enclose it inside of [ code ] [ / code ] tags, but without the spaces in the tags. Link to comment https://forums.phpfreaks.com/topic/28132-parser-error/#findComment-128940 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.