Jump to content

action="<? php echo SERVER['PHP_SELF']; ?>


franknu

Recommended Posts

well i have a update session that is not updating i thought because i had diffrent form running now

 

i try to created with the server['hp_self]; ?>

 

but i was getting a sytax error

 

here is the code

 

$query = "SELECT * FROM business_info WHERE `BusinessName`= '$BusinessName'
               AND `User_Name`='$User_Name'";

$result = mysql_query($query) or die (mysql_error());
$res2 = mysql_fetch_assoc($result);




echo "$BusinessName";

if(isset($_GET['update']))
{



$query="UPDATE  business_info  SET `BusinessName`= '$BusinessName', `Slogan`='{$Slogan}',
               `Business_Address`='{$Business_Address}', `Tel`='{$Tel}', `Website`='$Website',
               `Email`='{$Email}', `Fax`='{$Fax}', `type`='{$type}',
               `make`='{$make}', `Categories`='{$Categories}', `Keyword`='{$Keyword}', `Picture1`='{$Picture1}',
               `Headline`='{$Headline}', `Slogan2`='{$Slogan2}', `Description1`='{$Description1}',
               `Description2`='{$Description2}', `Description3`= '{$Description3}',
               `Picture2`='{$Picture2}', `Picture3`='{$Picture3}',
               `Password`='{$Password}' WHERE `User_Name`='{$User_Name}'";


$result = mysql_query($query) or die (mysql_error());
}




echo"<table bgcolor='ffffff'>";
  echo"<tr>";
    echo"<td>";
        echo"<table>";
          echo"<tr>";

                     echo"</tr>";
        echo"</table>";
      echo"</td>";
  echo"</tr>";
  echo"<tr>";
    echo"<td></td>";
  echo"</tr>";
  echo"<tr>";
    echo"<td>";
    echo"<table> ";
       echo" <tr>";

	  echo"<td>";

	 echo"<table bgcolor='ffffff '>";
echo" <tr>";
  echo"<td>";
echo"<table>";
// Hre is where is the error 
echo"<form action='<? PHP $_SERVER['PHP_SELF'] ;  ?>' method='Post'>";

echo"<tr>";
    echo"<td>";
    echo"Business Info";
    echo"</td>";
  echo"</tr>";
  echo"<tr>";
    echo"<td>";
    echo"<table>";
        echo"<tr>";
          echo"<td>";
          echo"Business Name";
          echo"</td>";
          echo"<td><input type='text' name='BusinessName' Value='$BusinessName'>";

          echo" </td>";

        echo"</tr>";
        echo"<tr>";
          echo"<td>";
          echo"Slogan";
          echo"</td>";

          echo"<td>

          <input type='text' NAME='Slogan' value='$Slogan'>";

         echo" </td>";
          echo"<td>";
          echo"Website";
          echo"</td>";

          echo"<td> <input type='text' name='Website' value='$Website'>";
          echo"</td>";
        echo"</tr>";

        echo"<tr>";

          echo"<td>";
          echo"Tel";
          echo"</td>";

          echo"<td>
          <input type='text' name='Tel' value='$Tel'>";
          echo"</td>";

          echo"<td>";
          echo"Key Words";
          echo"</td>";
          echo"<td>
        <input type='text' name='Keyword'  value='$Keyword'>";
       echo "</td>";

       echo" </tr>";
        echo"<tr>";
          echo"<td>";
          echo"Fax";
          echo"</td>";

          echo"<td>
          <input type='text' name='Fax' value='$fax'>";
          echo" </td>  ";

          echo"<td>";
          echo"Address"
          ;
          echo"</td>";
          echo"<td> <input type='text' name='Business_Address' value='$Business_Address'>";
          echo" </td>";

       echo" </tr>";

      echo"</table>";
      echo"</td>";

  echo"</tr>";
  echo"<tr>";
    echo"<td>";

echo"<table>";
        echo"<tr>";
          echo"<td>";
         
          echo"</td>";
          echo"<td>";
          echo"</td>";

          echo"<td>";
          
          echo"</td>";

          echo"<td> ";

			  echo"</td>";
          echo"<td>";
          echo"Category";
          echo"</td>";

          echo"<td>";

echo" <TEXTAREA ROWS=5 COLS=65  NAME='Categories' value='$Categories'> $Categories </TEXTAREA>";
          echo"</td>";

        echo"</tr>";
      echo"</table>";
  echo"<table>";
        echo"<tr>";
          echo"<td>";
          echo"Business  Webpage";
          echo"</td>";
        echo"</tr>";
        echo"<tr>";
          echo"<td>";
          echo"Headline";
          echo"</td>";
        echo"</tr>";
        echo"<tr>";
         echo" <td> <input type='text' name='Headline' value='$Headline'>";
         echo" </td>";

        echo"</tr>";
        echo"<tr>";
          echo"<td>";
          echo"Slogan";

           echo"</td>";
        echo"</tr>";
        echo"<tr>";
          echo"<td> <input type='text' name='Slogan2' value='$Slogan2'>";
          echo"</td>";
   echo"     </tr>";
        echo"<tr>";
                     echo" <td>";
                     echo"Description1";
                     echo" </td>";
        echo"</tr>";
        echo"<tr>";
          echo"<td>";
          echo"<TEXTAREA ROWS=5 COLS=65 NAME='Description1' value='$Description1'>$Description1 </TEXTAREA> ";

          echo"</td>";
        echo"</tr>";
        echo"<tr>";
          echo"<td>";
          echo"Description2";
          echo"</td>";
        echo"</tr>";
        echo"<tr>";
          echo"<td>
          <TEXTAREA ROWS=5 COLS=65 NAME='Description2' value='$Description2'>$Description2</TEXTAREA>";
          echo"</td>";
        echo"</tr>";
       echo" <tr>";
          echo"<td>";
          echo"Description3";
          echo"</td>";
        echo"</tr>";
        echo"<tr>";
          echo"<td><TEXTAREA ROWS=5 COLS=65 NAME='Description3' value='$Description3'>$Description3</TEXTAREA>";
          echo"</td>";
        echo"</tr>";

       echo" <tr>";
         echo" <td>";

         echo"<table>";
              echo"<tr>";
                echo"<td>";
                echo"User Name";
                echo"</td>";
                echo"<td> <input type='text' name='User_Name' value='$User_Name'>";
                echo"</td>";
                echo"<td>";
                echo"Password";
                echo"</td>";
                echo"<td> <input type='text' name='Password' value='$Password'>";
                echo"</td>";
              echo"</tr>";
            echo"</table>";
            echo"</td>";
        echo"</tr>";
      echo"</table>";
      echo" </td>";
echo"</tr>";
  echo"<tr>";
    echo"<td>
    <input type='submit'  value='Update my database' name='update' />
        <input type='reset' value='Reset fields' />";
      echo"<td> ";
  echo"</form>";

echo"</table>";

echo"</td>";
          echo"<td>";
          echo"</td>";
       echo" </tr>";
      echo"</table>";
   echo"</td>";
echo"</table> "  ;
echo" </tr>";

       //finish here
echo "<td>  </td>";
		echo"</td>";
          echo"<td  valign='top'>";

	  echo"</td>";
        echo"</tr>";
      echo"</table>";

  echo"</td>";
  echo"</tr>";
echo"</table>";

}

?>

 

 

here is my display Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/townsfin/public_html/authorization/Update_Page.php on line 242

 

 

please help

Link to comment
https://forums.phpfreaks.com/topic/44049-action/
Share on other sites

One step at a time.

 

You retrieve data from the database and use that to display in the form.

 

You then (presumably) edit some of the information and submit the form.

 

The values that you want to put back into the database are in the $_POST() array unless your server has register_globals set to ON (an insecure and outmoded practice).

 

So, for example, the actual value of the POSTed variable named email is not $email, it's $_POST['email'].  Similarly for all other values in the form.

 

You can check what's actually happening to your query by adding a line to echo $query. Then you'll see exactly what the query string is.

 

The query at the top of your code probably isn't returning any data because the variables in the query aren't set.  Echo that one as well to see what's really in it.

Link to comment
https://forums.phpfreaks.com/topic/44049-action/#findComment-213982
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.