Re: Strange error in a very simple PHP file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
To: "Jacob Kruger" <jacobk@xxxxxxxxxxx>
Cc: <php-windows@xxxxxxxxxxxxx>
Sent: Thursday, January 10, 2008 4:10 PM
Subject: Re:  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@xxxxxxxxx

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux