LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-19-2008, 09:26 PM   #1
markizano
LQ Newbie
 
Registered: Mar 2008
Posts: 3

Rep: Reputation: 0
Angry 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
 
Old 03-19-2008, 09:58 PM   #2
shambler
Member
 
Registered: Sep 2006
Location: Canada
Distribution: openSUSE 11.3, Xubuntu 10.10, Ubuntu 11.04
Posts: 53

Rep: Reputation: 23
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%...
 
Old 03-21-2008, 12:24 PM   #3
markizano
LQ Newbie
 
Registered: Mar 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Wow, wow, wow. I so totally missed that, omg. TY much.

i feel like an idiot now...lol
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Parse error: parse error, unexpected '/' - can anyone see the error in this code? v@ny@ Programming 8 04-03-2010 04:07 PM
What's the meaning of "PHP Parse error: parse error, unexpected $ in..." frandalla Programming 23 03-04-2009 12:34 PM
Parse error: parse error, unexpected $ in /home/content/d/o/m/domain/html/addpuppy2.p Scooby-Doo Programming 3 10-25-2007 09:41 AM
need help with "Parse error: parse error, unexpected T_STRING" coffee245 Programming 2 01-29-2007 11:53 AM
PHP parse error unexpected '>' ldp Programming 2 03-04-2005 02:20 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration