LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Parse Error: Unexpected $ (https://www.linuxquestions.org/questions/programming-9/parse-error-unexpected-%24-629340/)

markizano 03-19-2008 09:26 PM

Parse Error: Unexpected $
 

Introductions

Ok...this is so freakin frustrating!

Here's the source code to the page I want to create:
Code:

<!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" xml:lang="en" lang="en">
<head>

 <link rel="stylesheet" href="http://markizano.net/Default.css" />
 
 <meta http-equiv="content-type" content="text/html; CharSet=ISO-8859-1" />
 <meta name="language" content="en, English" />

 <title> Code.Markizano.net -&gt; Forums -&gt; Register </title>
 
 <style type="text/css">
  form{
  font-family:comic sans ms, sans;
  font-size:14px;
  text-align:left;}
 
  table{
  text-align:right;
  }

  .ErrTxt{
  font-family:Lucida Console;
  font-size:16px;
  text-align:left;
  color:#FF0000;
  text-decoration:underline;
  }
 
 </style>
 
<?php
/*
$BeginScript="<script type='text/javascript' language='javascript'>\n <!-- \n";
$EndScript="\n //--> \n </script>";

function ThisSpan($Text){
return "<td style='text-align:left;'><span class='ErrTxt'>".$Text."</span></td> \n";
}

function PassBlank($p1, $p2){
    if(! $p1){
    echo ThisSpan("You must enter a password.");
    return false;
    }
    if(! $p2){
    echo ThisSpan("You must verify the password.");
    return false;
    }
    if(($p1 != "")&&($p2 != "")){
    return true;
    }
}

function PassMatch($p1, $p2){
    if(PassBlank($p1, $p2) == true){
    if($p1 == $p2){return true;}else{return false;}
    }
    else{return false;}
}

function IsName($Name, $Text){
    if(! $Name){
    echo ThisSpan("You must select a ".$Text.".");
    return false;
    }
    else{return true;}
}

function EmailBlank($e1, $e2){
    if(! $e1){
    echo ThisSpan("You must enter a valid email address.");
    return false;
    }
    if(! $e2){
    echo ThisSpan("You must verify the email address.");
    return false;
    }
    if(($e1 != "")&&($e2 != "")){
    return true;
    }
}

function EmailMatch($e1, $e2){
    if(EmailBlank($e1, $e2) == true){
    if($e1 == $e2){return true;}
    else{echo ThisSpan("The email addresses must match.");return false;}
    }
    else{return false;}
}
*/
?>
 
  <script type="text/javascript" language="javascript">
  <!--
    function postme(){document.location.href='Register.php?action=post';}
  //-->
  </script>

</head>
<!--
********************************************************
ULTIMATE QUESTION: How you you place the $_Request variables back into the textboxes.
********************************************************
-->
<body>
 <form action="Register.php" name="reg" id="reg" method="post" runat="server">
  <table align="center" border="3" cellpadding="3" cellspacing="2" bordercolor="#FFFFFF" width='<?php if($_REQUEST["action"] == "post"){echo "auto";}else{echo "60%";}' ID="Table1">
  <caption>
    Fill out this form to become a member of Markizano.net. Registering here is the same
    as registering on Story.Markizano.net. Boxes colored in grey are not required.
  </caption>
  <tr>
    <td>
    First Name: <input type="text" maxlength="255" id="FName" name="FName" />
    </td>
    <?php
    /*
    if($_REQUEST["action"] == "post"){
      IsName($_REQUEST["FName"], "First Name");
    }
    */
    ?>
  </tr>
  <tr>
    <td bgcolor="#888888">
    Last Name: <input type="text" maxlength="255" id="LName" name="LName" />
    </td>
  </tr>
  <tr>
    <td bgcolor="#888888">
    Location (City, State, Country): <input type="text" id="Loc" name="Loc" />
    </td>
  </tr>
  <tr>
    <td>
    Select a User Name: <input type="text" maxlength="255" id="UName" name="UName" />
    </td>
    <?php
    /*
    if($_REQUEST["action"] == "post"){
      IsName($_REQUEST["UName"], "User Name");
    }
    */
    ?>
  </tr>
  <tr>
    <td style="text-align:right;">
    Select a Password: <input type="text" maxlength="255" id="Pass1" name="Pass1" /><br />
    Type the Password again to confirm: <input type="text" maxlength="255" id="Pass2" name="Pass2" /><br />
    </td>
    <?php
    /*
    if($_REQUEST["action"] == "post"){
      PassMatch($_REQUEST["Pass1"], $_REQUEST["Pass2"]);
    }
    */
    ?>
  </tr>
  <tr>
    <td style="text-align:right">
    Type your email address: <input type="text" id="email1" name="email1" /><br />
    Confirm your email address: <input type="text" id="email2" name="email2" />
    </td>
    <?php
    /*
    if($_REQUEST["action"] == "post"){
      EmailMatch($_REQUEST["email1"], $_REQUEST["email2"]);
    }
    */
    ?>
  </tr>
  <tr>
    <td colspan="2" style="text-align:center">
    <input type="button" name="cmdGo" id="cmdGo" value="Submit" onclick="postme();" /> <br />
    </td>
  </tr>
  </table>
 </form>
</body>

</html>

now to the point: a link to this page can be found here:

http://code.markizano.net/Forums/Register.php

I get the same parse error that frandalla got. Only, I've commented every piece of PHP code and it still gives me this error. Logically, as I believe it there should be absolutely NO php code that the server can execute, therefore there should be absolutely NO error. I am beginning to believe that this is something bigger than just this one file.
I am running on a UNIX server via freehostia.com.
I have it set up to run PHP 5 (which revision, it won't tell)

I originally found these forums via google:

Whats the meaning of Parse Error.


I know what it means (its pretty simple), its finding the error that is the problem. There are only three files in the directory:
Code:

index.php 'The deafault page
Register.php 'The registration page
error.html 'The error page if something was called incorrectly (e.g. IO.File.Exist(URL) = False)

If this doesn't work, I have other solutions. My next objective is to create a new .php file and piece by piece, re-create the file and see when the error pops up. If that doesn't work, I'm going to phpbbnow.com

shambler 03-19-2008 09:58 PM

You missed a close php
 
You embedded some php in the table.

Code:

          <table align="center" border="3" cellpadding="3" cellspacing="2" bordercolor="#FFFFFF" width='<?php if($_REQUEST["action"] == "post"){echo "auto";}else{echo "60%";}' ID="Table1">
Should be:

Code:

          <table align="center" border="3" cellpadding="3" cellspacing="2" bordercolor="#FFFFFF" width='<?php if($_REQUEST["action"] == "post"){echo "auto";}else{echo "60%";}?>' ID="Table1">
Look just past the 60%...

markizano 03-21-2008 12:24 PM

Wow, wow, wow. I so totally missed that, omg. TY much.

i feel like an idiot now...lol


All times are GMT -5. The time now is 07:48 PM.