Jump to content

parser error


franknu

Recommended Posts

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 why

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());

$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 65

this is what i have on line 65

62: 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
Share on other sites

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 22

this 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
Share on other sites

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 22

this 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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.