Re: Strange error in a very simple PHP file

From: Date: Thu, 10 Jan 2008 14:59:16 +0000
Subject: Re: Strange error in a very simple PHP file
References: 1 2 3  Groups: php.windows 
Request: Send a blank email to php-windows+get-28698@lists.php.net to get a copy of this message
No matching "}" for segment started on line 8... Jacob Kruger wrote:
Well, 'looked' through the file, and haven't found anything like a missing ; or ?> so I dunno. Here's the full source thereof (maybe I'm actually 'missing' something due to my screenreader not 'seeing' it or something - LOL!) ---start of source--- <?php session_start(); ?> <!doctype html public "-//W3C//DTD HTML 4.0 //EN"> <html> <head>
      <title>Backend</title>
<?php if (array_key_exists("btnGo", $_POST)) {
       //echo "here you go...";
       if ($_POST("admPass")=="adminpassword")
       {
                        $_SESSION["admin"] = "true";
//                         echo "<script type=\"text/javascript\">window.location=\"main.php\";</script>";
RedirectURL("main.php"); } function RedirectURL($url) { // This calls javascript $redir = "<script language=\"javascript\">location.href=\"$url\"</script>\n"; return $redir; } ?> </head> <body> <form method="post" action="index.php" enctype="multipart/form-data" name="form1"> <table align="center" border="0"> <tr>
       <th align="center" colspan="2">
       Log-in
       </th>
       </tr>
       <tr>
       <th align="right">Password</th>
       <td><input type="password" name="admPass" size="50" /></td>
       </tr>
       <tr>
       <th align="center" colspan="2"><input type="submit" name="btnGo" value="Go" /></th>
       </tr>
</table> </form> </body> </html> ---end of source--- Like I said, the line it seems to reckon the problem is on is that very last line, but it makes sense that the PHP renderer engine thinks it's just missing something by then - who knows... Thanks in advance Jacob Kruger Blind Biker Skype: BlindZA '...Fate had broken his body, but not his spirit...' ----- Original Message ----- From: "Jarrett Meyer" <jmtmeyer@yahoo.com> To: "Jacob Kruger" <jacobk@cknet.co.za> Cc: <php-windows@lists.php.net> Sent: Thursday, January 10, 2008 4:10 PM Subject: Re: [PHP-WIN] Strange error in a very simple PHP file
In my experience, it probably means that you're missing a closing brace or the semicolon on the very last line of PHP code. Jacob Kruger wrote:
In a very simple .php file where you're basically supposed to enter a password to then log-on to the backend of a site, I'm getting a very strange error: Parse error: syntax error, unexpected $end in C:\wamp\www\blindza\admin\index.php on line 43 Line 43 actually only has the text "</html>" on it (without the quotes).
<snip> -- Jarrett M. T. Meyer jmtmeyer@yahoo.com -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- Jarrett M. T. Meyer jmtmeyer@yahoo.com

« previous php.windows (#28698) next »