Strange error in a very simple PHP file

Strange error in a very simple PHP file

am 10.01.2008 14:53:27 von Jacob Kruger

Hi there

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 "" on it (without the quotes).

In the rest of that file, there's literally just a small bit of code that
basically starts a session right at the top of the code/scripting, checks to
see if you've entered the correct password into the relevant field (if
you've actually submitted the form at all), and then basically tries to do a
redirect of sorts, but the page won't even display any of the HTML, let
alone let you try to actually submit the form since the first time I even
try to load/view the page, all it spits out is that error message.

Any thoughts on this?

FWIW, I'm running the WAMP server, and have tried editing that file using
the PHP coder IDE, TextPal, Notepad++, Notepad etc. etc. to see if there was
maybe some sort of invalid character somewhere, but I haven't found anything
yet even if I tell one or two of the editors to as such display 'all'
characters.

Thanks in advance

Jacob Kruger
Blind Biker
Skype: BlindZA
'...Fate had broken his body, but not his spirit...'

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

Re: Strange error in a very simple PHP file

am 10.01.2008 15:10:16 von Jarrett Meyer

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 "" on it (without the quotes).
>


--
Jarrett M. T. Meyer
jmtmeyer@yahoo.com

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

Re: Strange error in a very simple PHP file

am 10.01.2008 15:53:17 von Jacob Kruger

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---




Backend
if (array_key_exists("btnGo", $_POST))
{
//echo "here you go...";
if ($_POST("admPass")=="adminpassword")
{
$_SESSION["admin"] = "true";
// echo "";
RedirectURL("main.php");

}
function RedirectURL($url)
{ // This calls javascript
$redir = "\n";
return $redir;
}

?>


name="form1">












Log-in
Password
value="Go" />




---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"
To: "Jacob Kruger"
Cc:
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 "" on it (without the quotes).
>>
>
>
> --
> Jarrett M. T. Meyer
> jmtmeyer@yahoo.com
>
> --
> 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

Re: Strange error in a very simple PHP file

am 10.01.2008 15:59:16 von Jarrett Meyer

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---
>
>
>
>
> Backend
> > if (array_key_exists("btnGo", $_POST))
> {
> //echo "here you go...";
> if ($_POST("admPass")=="adminpassword")
> {
> $_SESSION["admin"] = "true";
> // echo "";
> RedirectURL("main.php");
>
> }
> function RedirectURL($url)
> { // This calls javascript
> $redir = "\n";
> return $redir;
> }
>
> ?>
>
>
>

> name="form1">
>
>
>
>
>
>
>
>
>
>
>
>

> Log-in
>
Password
> name="btnGo" value="Go" />

>

>
>
> ---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"
> To: "Jacob Kruger"
> Cc:
> 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 "" on it (without the
>>> quotes).
>>>
>>
>>
>> --
>> 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

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

Re: Strange error in a very simple PHP file

am 10.01.2008 16:04:16 von Jacob Kruger

Ok.

Thanks.

Funny enough one of my first stuff-ups was that I didn't initially realise
that all three different types of parentheses, brackets, and braces were
being used since I was sort of listening for cues as opposed to listening to
specific details, and I suppose this is pretty much related.

I know that one or two of the editing programs I use can in fact sort of do
'matches' for opening and closeing braces {}, and maybe they can then also
double-check for ones that then don't having matching ones or something.

Anyway, thanks again - will fix it and go on from there...

Stay well

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:59 PM
Subject: Re: [PHP-WIN] Strange error in a very simple PHP file

> 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---
>>
>>
>>
>>
>> Backend
>> >> if (array_key_exists("btnGo", $_POST))
>> {
>> //echo "here you go...";
>> if ($_POST("admPass")=="adminpassword")
>> {
>> $_SESSION["admin"] = "true";
>> // echo "";
>> RedirectURL("main.php");
>>
>> }
>> function RedirectURL($url)
>> { // This calls javascript
>> $redir = "\n";
>> return $redir;
>> }
>>
>> ?>
>>
>>
>>

>> name="form1">
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>

>> Log-in
>>
Password
>> value="Go" />

>>

>>
>>
>> ---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 "" on it (without the
>>>> quotes).
>>>>
>>>
>>>
>>> --
>>> 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
>
>
>

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