[PHP] RE: Am i crazy?

2001-11-04 Thread ArsenKirillov

Why not
if (file_exists($fname="$MYPATH/admin.php") && $name='admin')) header
("Location: ".$fname) ;else echo "Trouble with $fname";

> -Original Message-
> From: Martin [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, November 04, 2001 7:49 PM
> To: [EMAIL PROTECTED]
> Subject: Am i crazy?
>
>
> Did I forget everything in a few months?
> if ($name='admin') {
> header("Location: $MYPATH/admin.php");
> }
>
> Doesn't. That is it doesn't redirect to whatever $MYPATH/admin.php
> translates to. Doing an echo $MYPATH directly after the line
> shows that the
> path is interpreted correctly - and the file exists (I checked). And the
> $name is correct - echo $name gives admin. And neither does the php.net
> example work ...
>
> if ($name='admin') {
> header("Location: http://www.php.net/";);
> }
>
> doesn't redirect to php.net.
>
> *sigh*
>
> Martin
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Am i crazy?

2001-11-04 Thread oliver walkhoff

sorry, didn't receive the answers from martin and jack before...
oliver

Martin wrote:

> Did I forget everything in a few months?
> if ($name='admin') {
> header("Location: $MYPATH/admin.php");
> }
>
> Doesn't. That is it doesn't redirect to whatever $MYPATH/admin.php
> translates to. Doing an echo $MYPATH directly after the line shows that the
> path is interpreted correctly - and the file exists (I checked). And the
> $name is correct - echo $name gives admin. And neither does the php.net
> example work ...
>
> if ($name='admin') {
> header("Location: http://www.php.net/";);
> }
>
> doesn't redirect to php.net.
>
> *sigh*
>
> Martin


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Am i crazy?

2001-11-04 Thread oliver walkhoff

> Did I forget everything in a few months?
> if ($name='admin') {
> header("Location: $MYPATH/admin.php");
> }

try if ($name =='admin') {

('==' instead of '=', otherwise you are assigning 'admin' to $name) !

oliver


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]