[PHP-DEV] PHP 4.0 Bug #10079 Updated: Header Function Within IF construct

2001-04-05 Thread sniper

ID: 10079
Updated by: sniper
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Closed
Old-Bug Type: Scripting Engine problem
Bug Type: *General Issues
Assigned To: 
Comments:

As this is a browser problem with only one browser and one
version of it -> closed. It's a bug in IE 5.01 SP2 so 
report it to Microsoft. IIRC they only support > 5.5 now so
good luck. 

--Jani


Previous Comments:
---

[2001-04-05 11:55:56] [EMAIL PROTECTED]
I did some more testing and have found that it is indeed browser related. MSIE 5.01 
SP2 have the problem and 5.00 and 5.5 do not. Have you tested with this browser? Also, 
why would PHP behave as it does? Is it a timing issue?


Dean

---

[2001-04-03 18:30:34] [EMAIL PROTECTED]
Yes, I double checked it and ServerType standalone is in my httpd.conf file.

If there is anything I can do to help you debug the problem, just let me know. If you 
want you can dial in and see for your self. This is not a production server that I am 
testing on, so we can do whatever to track this down.

The problem I'm having, is that I want to do some authentication but code that should 
not execute is getting executed.


Dean

---

[2001-04-03 10:30:02] [EMAIL PROTECTED]
Try this script:

");
header('WWW-Authenticate: Basic Realm="A Test R"');
header("HTTP/1.0 401 Unauthorized");
echo "boo";
} else {
echo "else";
}

?>

I can't reproduce the problem you have.

--Jani

p.s. Are you sure that you have this in your httpd.conf:

ServerType standalone 




---

[2001-04-03 09:31:00] [EMAIL PROTECTED]
I was able to get PHP-4.0.5 installed and I still have the same problem. Is there 
anything else you would like me to try? Is this a bug or expected behaviour?

Thanks for help.


Dean

---

[2001-03-30 16:56:37] [EMAIL PROTECTED]
I guess I'm doing this right... I downloaded php4-200103301245.tar.gz. Unzipped, 
untarred and configured using --with-mysql --with-apache --with-trans-sid 
--enable-track-vars --enable-sysvsem --enable-sysvshm

All configured fine. But make is not making

I'm getting symbol referencing errors. It is quite possible that this version is not 
quite ready for SCO OpenServer. If you want, I'll send you the debug.log file from the 
make operation. I'm not sure if you even mess with installation problems of PHP in 
this forum.

I have a question: Is the annomally I reported a bug in 4.0.4pl1 or is it just my 
system?

Dean

---

The remainder of the comments for this report are too long.  To view the rest of the 
comments, please view the bug report online.


ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10079&edit=2


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #10079 Updated: Header Function Within IF construct

2001-04-05 Thread dgrimes

ID: 10079
User Update by: [EMAIL PROTECTED]
Status: Open
Bug Type: Scripting Engine problem
Description: Header Function Within IF construct

I did some more testing and have found that it is indeed browser related. MSIE 5.01 
SP2 have the problem and 5.00 and 5.5 do not. Have you tested with this browser? Also, 
why would PHP behave as it does? Is it a timing issue?


Dean

Previous Comments:
---

[2001-04-03 18:30:34] [EMAIL PROTECTED]
Yes, I double checked it and ServerType standalone is in my httpd.conf file.

If there is anything I can do to help you debug the problem, just let me know. If you 
want you can dial in and see for your self. This is not a production server that I am 
testing on, so we can do whatever to track this down.

The problem I'm having, is that I want to do some authentication but code that should 
not execute is getting executed.


Dean

---

[2001-04-03 10:30:02] [EMAIL PROTECTED]
Try this script:

");
header('WWW-Authenticate: Basic Realm="A Test R"');
header("HTTP/1.0 401 Unauthorized");
echo "boo";
} else {
echo "else";
}

?>

I can't reproduce the problem you have.

--Jani

p.s. Are you sure that you have this in your httpd.conf:

ServerType standalone 




---

[2001-04-03 09:31:00] [EMAIL PROTECTED]
I was able to get PHP-4.0.5 installed and I still have the same problem. Is there 
anything else you would like me to try? Is this a bug or expected behaviour?

Thanks for help.


Dean

---

[2001-03-30 16:56:37] [EMAIL PROTECTED]
I guess I'm doing this right... I downloaded php4-200103301245.tar.gz. Unzipped, 
untarred and configured using --with-mysql --with-apache --with-trans-sid 
--enable-track-vars --enable-sysvsem --enable-sysvshm

All configured fine. But make is not making

I'm getting symbol referencing errors. It is quite possible that this version is not 
quite ready for SCO OpenServer. If you want, I'll send you the debug.log file from the 
make operation. I'm not sure if you even mess with installation problems of PHP in 
this forum.

I have a question: Is the annomally I reported a bug in 4.0.4pl1 or is it just my 
system?

Dean

---

[2001-03-30 15:45:58] [EMAIL PROTECTED]
http://snaps.php.net/



---

The remainder of the comments for this report are too long.  To view the rest of the 
comments, please view the bug report online.

Full Bug description available at: http://bugs.php.net/?id=10079


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #10079 Updated: Header Function Within IF construct

2001-04-03 Thread dgrimes

ID: 10079
User Update by: [EMAIL PROTECTED]
Old-Status: Feedback
Status: Open
Bug Type: Scripting Engine problem
Description: Header Function Within IF construct

Yes, I double checked it and ServerType standalone is in my httpd.conf file.

If there is anything I can do to help you debug the problem, just let me know. If you 
want you can dial in and see for your self. This is not a production server that I am 
testing on, so we can do whatever to track this down.

The problem I'm having, is that I want to do some authentication but code that should 
not execute is getting executed.


Dean

Previous Comments:
---

[2001-04-03 10:30:02] [EMAIL PROTECTED]
Try this script:

");
header('WWW-Authenticate: Basic Realm="A Test R"');
header("HTTP/1.0 401 Unauthorized");
echo "boo";
} else {
echo "else";
}

?>

I can't reproduce the problem you have.

--Jani

p.s. Are you sure that you have this in your httpd.conf:

ServerType standalone 




---

[2001-04-03 09:31:00] [EMAIL PROTECTED]
I was able to get PHP-4.0.5 installed and I still have the same problem. Is there 
anything else you would like me to try? Is this a bug or expected behaviour?

Thanks for help.


Dean

---

[2001-03-30 16:56:37] [EMAIL PROTECTED]
I guess I'm doing this right... I downloaded php4-200103301245.tar.gz. Unzipped, 
untarred and configured using --with-mysql --with-apache --with-trans-sid 
--enable-track-vars --enable-sysvsem --enable-sysvshm

All configured fine. But make is not making

I'm getting symbol referencing errors. It is quite possible that this version is not 
quite ready for SCO OpenServer. If you want, I'll send you the debug.log file from the 
make operation. I'm not sure if you even mess with installation problems of PHP in 
this forum.

I have a question: Is the annomally I reported a bug in 4.0.4pl1 or is it just my 
system?

Dean

---

[2001-03-30 15:45:58] [EMAIL PROTECTED]
http://snaps.php.net/



---

[2001-03-30 15:21:34] [EMAIL PROTECTED]
Apache is running standalone as a daemon.
.
No, I havn't tried 4.0.5. I'll give it try ... Just tell where to download it.

Dean

---

The remainder of the comments for this report are too long.  To view the rest of the 
comments, please view the bug report online.

Full Bug description available at: http://bugs.php.net/?id=10079


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #10079 Updated: Header Function Within IF construct

2001-04-03 Thread dgrimes

ID: 10079
User Update by: [EMAIL PROTECTED]
Status: Feedback
Bug Type: Scripting Engine problem
Description: Header Function Within IF construct

I was able to get PHP-4.0.5 installed and I still have the same problem. Is there 
anything else you would like me to try? Is this a bug or expected behaviour?

Thanks for help.


Dean

Previous Comments:
---

[2001-03-30 16:56:37] [EMAIL PROTECTED]
I guess I'm doing this right... I downloaded php4-200103301245.tar.gz. Unzipped, 
untarred and configured using --with-mysql --with-apache --with-trans-sid 
--enable-track-vars --enable-sysvsem --enable-sysvshm

All configured fine. But make is not making

I'm getting symbol referencing errors. It is quite possible that this version is not 
quite ready for SCO OpenServer. If you want, I'll send you the debug.log file from the 
make operation. I'm not sure if you even mess with installation problems of PHP in 
this forum.

I have a question: Is the annomally I reported a bug in 4.0.4pl1 or is it just my 
system?

Dean

---

[2001-03-30 15:45:58] [EMAIL PROTECTED]
http://snaps.php.net/



---

[2001-03-30 15:21:34] [EMAIL PROTECTED]
Apache is running standalone as a daemon.
.
No, I havn't tried 4.0.5. I'll give it try ... Just tell where to download it.

Dean

---

[2001-03-30 15:12:11] [EMAIL PROTECTED]
Open -> Feedback

That's rather annoying that the state is not saved, is anyone working on this?  I know 
there is a new system coming, but not for a while.  Or where is it located in CVS and 
I'll fix it.

-Chris

---

[2001-03-30 15:10:11] [EMAIL PROTECTED]
Use the web interface, do not reply to these emails.

I did not try it because i did not have the time.  I just  tried it and did not get 
those same results.

After the first login it did create the file, I deleted, refreshed, no file...did what 
it is supposed to.

I am however using a CVS version of 4.0.5, have you tried it with the CVS version?

-Chris


---

The remainder of the comments for this report are too long.  To view the rest of the 
comments, please view the bug report online.

Full Bug description available at: http://bugs.php.net/?id=10079


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #10079 Updated: Header Function Within IF construct

2001-03-30 Thread dgrimes

ID: 10079
User Update by: [EMAIL PROTECTED]
Status: Feedback
Bug Type: Scripting Engine problem
Description: Header Function Within IF construct

I guess I'm doing this right... I downloaded php4-200103301245.tar.gz. Unzipped, 
untarred and configured using --with-mysql --with-apache --with-trans-sid 
--enable-track-vars --enable-sysvsem --enable-sysvshm

All configured fine. But make is not making

I'm getting symbol referencing errors. It is quite possible that this version is not 
quite ready for SCO OpenServer. If you want, I'll send you the debug.log file from the 
make operation. I'm not sure if you even mess with installation problems of PHP in 
this forum.

I have a question: Is the annomally I reported a bug in 4.0.4pl1 or is it just my 
system?

Dean

Previous Comments:
---

[2001-03-30 15:45:58] [EMAIL PROTECTED]
http://snaps.php.net/



---

[2001-03-30 15:21:34] [EMAIL PROTECTED]
Apache is running standalone as a daemon.
.
No, I havn't tried 4.0.5. I'll give it try ... Just tell where to download it.

Dean

---

[2001-03-30 15:12:11] [EMAIL PROTECTED]
Open -> Feedback

That's rather annoying that the state is not saved, is anyone working on this?  I know 
there is a new system coming, but not for a while.  Or where is it located in CVS and 
I'll fix it.

-Chris

---

[2001-03-30 15:10:11] [EMAIL PROTECTED]
Use the web interface, do not reply to these emails.

I did not try it because i did not have the time.  I just  tried it and did not get 
those same results.

After the first login it did create the file, I deleted, refreshed, no file...did what 
it is supposed to.

I am however using a CVS version of 4.0.5, have you tried it with the CVS version?

-Chris


---

[2001-03-30 12:34:38] [EMAIL PROTECTED]
Are you running Apache as standalone or inetd?

If I remember right, PHP/Apache/inetd likes to lose env variables.

-Chris

---

The remainder of the comments for this report are too long.  To view the rest of the 
comments, please view the bug report online.

Full Bug description available at: http://bugs.php.net/?id=10079


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #10079 Updated: Header Function Within IF construct

2001-03-30 Thread sniper

ID: 10079
Updated by: sniper
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Feedback
Bug Type: Scripting Engine problem
Assigned To: 
Comments:

http://snaps.php.net/



Previous Comments:
---

[2001-03-30 15:21:34] [EMAIL PROTECTED]
Apache is running standalone as a daemon.
.
No, I havn't tried 4.0.5. I'll give it try ... Just tell where to download it.

Dean

---

[2001-03-30 15:12:11] [EMAIL PROTECTED]
Open -> Feedback

That's rather annoying that the state is not saved, is anyone working on this?  I know 
there is a new system coming, but not for a while.  Or where is it located in CVS and 
I'll fix it.

-Chris

---

[2001-03-30 15:10:11] [EMAIL PROTECTED]
Use the web interface, do not reply to these emails.

I did not try it because i did not have the time.  I just  tried it and did not get 
those same results.

After the first login it did create the file, I deleted, refreshed, no file...did what 
it is supposed to.

I am however using a CVS version of 4.0.5, have you tried it with the CVS version?

-Chris


---

[2001-03-30 12:34:38] [EMAIL PROTECTED]
Are you running Apache as standalone or inetd?

If I remember right, PHP/Apache/inetd likes to lose env variables.

-Chris

---

[2001-03-30 11:38:36] [EMAIL PROTECTED]
");
Header("WWW-Authenticate: Basic realm="Realm"");
Header("HTTP/1.0 401 Unauthorized");
} else
echo "else";

?>


Compiler: gcc 2.95.2
Make: GNU 3.79
FSU Pthreads: 3.8

Apache: 1.3.19
MySQL: 3.23.36
PHP: 4.0.4pl1
Freetype: 2.0
LibPNG: 1.0.9
LibJPEG: 6b
Libgd: 1.8.4

PHP is compiled as an Apache module with the following options:

--with-mysql --with-apache --with-pdflib --with-gd --with-trans-sid 
--enable-track-vars --enable-sysvsem --enable-sysvshm

Description of problem:

Both sides of the IF construct are being executed when testing the $PHP_AUTH_USER 
variable AND issuing the header function. I posted this question in the general mail 
list but have received any reponse from anyoneso

Using the script list above, follow the steps shown below to produce this problem:

1. Close all instances of your browser (I am using IE-5.01 and I have not tried any 
other browsers). However I don't believe it is a browser issue.

2. Run the script shown above.

3. Enter some user ID and password... Everything so far works fine.

4. Look in the directory where the script is stored. There should be a file called 
. This indicates that $PHP_AUTH_USER was NOT set.

5. Remove the file .

6. Refresh the browser. Look for the file . Notice that  is present; which 
should only happen if $PHP_AUTH_USER is NOT setYET "else" was printed on screen 
which indicates that $PHP_AUTH_USER IS set.

7. Uncomment the commented "header" line and notice that a user ID and password prompt 
is always issued in this case.


My questions are:

1. Why are both sides of the conditional "If (!isset($PHP_AUTH_USER))" being executed?

2. Why, when $PHP_AUTH_USER is not set, the 'exec(">")' runs on subsequent 
refreshes, but no prompt for a new user ID and password is issued?

3. Why, if a authenticate header is sent before testing, a user ID and password prompt 
is issued?




Thanks for taking a look at this.


Dean

---

The remainder of the comments for this report are too long.  To view the rest of the 
comments, please view the bug report online.


ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10079&edit=2


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #10079 Updated: Header Function Within IF construct

2001-03-30 Thread dgrimes

ID: 10079
User Update by: [EMAIL PROTECTED]
Old-Status: Feedback
Status: Open
Bug Type: Scripting Engine problem
Description: Header Function Within IF construct

Apache is running standalone as a daemon.
.
No, I havn't tried 4.0.5. I'll give it try ... Just tell where to download it.

Dean

Previous Comments:
---

[2001-03-30 15:12:11] [EMAIL PROTECTED]
Open -> Feedback

That's rather annoying that the state is not saved, is anyone working on this?  I know 
there is a new system coming, but not for a while.  Or where is it located in CVS and 
I'll fix it.

-Chris

---

[2001-03-30 15:10:11] [EMAIL PROTECTED]
Use the web interface, do not reply to these emails.

I did not try it because i did not have the time.  I just  tried it and did not get 
those same results.

After the first login it did create the file, I deleted, refreshed, no file...did what 
it is supposed to.

I am however using a CVS version of 4.0.5, have you tried it with the CVS version?

-Chris


---

[2001-03-30 12:34:38] [EMAIL PROTECTED]
Are you running Apache as standalone or inetd?

If I remember right, PHP/Apache/inetd likes to lose env variables.

-Chris

---

[2001-03-30 11:38:36] [EMAIL PROTECTED]
");
Header("WWW-Authenticate: Basic realm="Realm"");
Header("HTTP/1.0 401 Unauthorized");
} else
echo "else";

?>


Compiler: gcc 2.95.2
Make: GNU 3.79
FSU Pthreads: 3.8

Apache: 1.3.19
MySQL: 3.23.36
PHP: 4.0.4pl1
Freetype: 2.0
LibPNG: 1.0.9
LibJPEG: 6b
Libgd: 1.8.4

PHP is compiled as an Apache module with the following options:

--with-mysql --with-apache --with-pdflib --with-gd --with-trans-sid 
--enable-track-vars --enable-sysvsem --enable-sysvshm

Description of problem:

Both sides of the IF construct are being executed when testing the $PHP_AUTH_USER 
variable AND issuing the header function. I posted this question in the general mail 
list but have received any reponse from anyoneso

Using the script list above, follow the steps shown below to produce this problem:

1. Close all instances of your browser (I am using IE-5.01 and I have not tried any 
other browsers). However I don't believe it is a browser issue.

2. Run the script shown above.

3. Enter some user ID and password... Everything so far works fine.

4. Look in the directory where the script is stored. There should be a file called 
. This indicates that $PHP_AUTH_USER was NOT set.

5. Remove the file .

6. Refresh the browser. Look for the file . Notice that  is present; which 
should only happen if $PHP_AUTH_USER is NOT setYET "else" was printed on screen 
which indicates that $PHP_AUTH_USER IS set.

7. Uncomment the commented "header" line and notice that a user ID and password prompt 
is always issued in this case.


My questions are:

1. Why are both sides of the conditional "If (!isset($PHP_AUTH_USER))" being executed?

2. Why, when $PHP_AUTH_USER is not set, the 'exec(">")' runs on subsequent 
refreshes, but no prompt for a new user ID and password is issued?

3. Why, if a authenticate header is sent before testing, a user ID and password prompt 
is issued?




Thanks for taking a look at this.


Dean

---


Full Bug description available at: http://bugs.php.net/?id=10079


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #10079 Updated: Header Function Within IF construct

2001-03-30 Thread cnewbill

ID: 10079
Updated by: cnewbill
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Feedback
Bug Type: Scripting Engine problem
Assigned To: 
Comments:

Open -> Feedback

That's rather annoying that the state is not saved, is anyone working on this?  I know 
there is a new system coming, but not for a while.  Or where is it located in CVS and 
I'll fix it.

-Chris

Previous Comments:
---

[2001-03-30 15:10:11] [EMAIL PROTECTED]
Use the web interface, do not reply to these emails.

I did not try it because i did not have the time.  I just  tried it and did not get 
those same results.

After the first login it did create the file, I deleted, refreshed, no file...did what 
it is supposed to.

I am however using a CVS version of 4.0.5, have you tried it with the CVS version?

-Chris


---

[2001-03-30 12:34:38] [EMAIL PROTECTED]
Are you running Apache as standalone or inetd?

If I remember right, PHP/Apache/inetd likes to lose env variables.

-Chris

---

[2001-03-30 11:38:36] [EMAIL PROTECTED]
");
Header("WWW-Authenticate: Basic realm="Realm"");
Header("HTTP/1.0 401 Unauthorized");
} else
echo "else";

?>


Compiler: gcc 2.95.2
Make: GNU 3.79
FSU Pthreads: 3.8

Apache: 1.3.19
MySQL: 3.23.36
PHP: 4.0.4pl1
Freetype: 2.0
LibPNG: 1.0.9
LibJPEG: 6b
Libgd: 1.8.4

PHP is compiled as an Apache module with the following options:

--with-mysql --with-apache --with-pdflib --with-gd --with-trans-sid 
--enable-track-vars --enable-sysvsem --enable-sysvshm

Description of problem:

Both sides of the IF construct are being executed when testing the $PHP_AUTH_USER 
variable AND issuing the header function. I posted this question in the general mail 
list but have received any reponse from anyoneso

Using the script list above, follow the steps shown below to produce this problem:

1. Close all instances of your browser (I am using IE-5.01 and I have not tried any 
other browsers). However I don't believe it is a browser issue.

2. Run the script shown above.

3. Enter some user ID and password... Everything so far works fine.

4. Look in the directory where the script is stored. There should be a file called 
. This indicates that $PHP_AUTH_USER was NOT set.

5. Remove the file .

6. Refresh the browser. Look for the file . Notice that  is present; which 
should only happen if $PHP_AUTH_USER is NOT setYET "else" was printed on screen 
which indicates that $PHP_AUTH_USER IS set.

7. Uncomment the commented "header" line and notice that a user ID and password prompt 
is always issued in this case.


My questions are:

1. Why are both sides of the conditional "If (!isset($PHP_AUTH_USER))" being executed?

2. Why, when $PHP_AUTH_USER is not set, the 'exec(">")' runs on subsequent 
refreshes, but no prompt for a new user ID and password is issued?

3. Why, if a authenticate header is sent before testing, a user ID and password prompt 
is issued?




Thanks for taking a look at this.


Dean

---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10079&edit=2


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #10079 Updated: Header Function Within IF construct

2001-03-30 Thread cnewbill

ID: 10079
Updated by: cnewbill
Reported By: [EMAIL PROTECTED]
Old-Status: Feedback
Status: Open
Bug Type: Scripting Engine problem
Assigned To: 
Comments:

Use the web interface, do not reply to these emails.

I did not try it because i did not have the time.  I just  tried it and did not get 
those same results.

After the first login it did create the file, I deleted, refreshed, no file...did what 
it is supposed to.

I am however using a CVS version of 4.0.5, have you tried it with the CVS version?

-Chris


Previous Comments:
---

[2001-03-30 12:34:38] [EMAIL PROTECTED]
Are you running Apache as standalone or inetd?

If I remember right, PHP/Apache/inetd likes to lose env variables.

-Chris

---

[2001-03-30 11:38:36] [EMAIL PROTECTED]
");
Header("WWW-Authenticate: Basic realm="Realm"");
Header("HTTP/1.0 401 Unauthorized");
} else
echo "else";

?>


Compiler: gcc 2.95.2
Make: GNU 3.79
FSU Pthreads: 3.8

Apache: 1.3.19
MySQL: 3.23.36
PHP: 4.0.4pl1
Freetype: 2.0
LibPNG: 1.0.9
LibJPEG: 6b
Libgd: 1.8.4

PHP is compiled as an Apache module with the following options:

--with-mysql --with-apache --with-pdflib --with-gd --with-trans-sid 
--enable-track-vars --enable-sysvsem --enable-sysvshm

Description of problem:

Both sides of the IF construct are being executed when testing the $PHP_AUTH_USER 
variable AND issuing the header function. I posted this question in the general mail 
list but have received any reponse from anyoneso

Using the script list above, follow the steps shown below to produce this problem:

1. Close all instances of your browser (I am using IE-5.01 and I have not tried any 
other browsers). However I don't believe it is a browser issue.

2. Run the script shown above.

3. Enter some user ID and password... Everything so far works fine.

4. Look in the directory where the script is stored. There should be a file called 
. This indicates that $PHP_AUTH_USER was NOT set.

5. Remove the file .

6. Refresh the browser. Look for the file . Notice that  is present; which 
should only happen if $PHP_AUTH_USER is NOT setYET "else" was printed on screen 
which indicates that $PHP_AUTH_USER IS set.

7. Uncomment the commented "header" line and notice that a user ID and password prompt 
is always issued in this case.


My questions are:

1. Why are both sides of the conditional "If (!isset($PHP_AUTH_USER))" being executed?

2. Why, when $PHP_AUTH_USER is not set, the 'exec(">")' runs on subsequent 
refreshes, but no prompt for a new user ID and password is issued?

3. Why, if a authenticate header is sent before testing, a user ID and password prompt 
is issued?




Thanks for taking a look at this.


Dean

---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10079&edit=2


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #10079 Updated: Header Function Within IF construct

2001-03-30 Thread sniper

ID: 10079
Updated by: sniper
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Feedback
Bug Type: Scripting Engine problem
Assigned To: 
Comments:



Previous Comments:
---

[2001-03-30 11:38:36] [EMAIL PROTECTED]
");
Header("WWW-Authenticate: Basic realm="Realm"");
Header("HTTP/1.0 401 Unauthorized");
} else
echo "else";

?>


Compiler: gcc 2.95.2
Make: GNU 3.79
FSU Pthreads: 3.8

Apache: 1.3.19
MySQL: 3.23.36
PHP: 4.0.4pl1
Freetype: 2.0
LibPNG: 1.0.9
LibJPEG: 6b
Libgd: 1.8.4

PHP is compiled as an Apache module with the following options:

--with-mysql --with-apache --with-pdflib --with-gd --with-trans-sid 
--enable-track-vars --enable-sysvsem --enable-sysvshm

Description of problem:

Both sides of the IF construct are being executed when testing the $PHP_AUTH_USER 
variable AND issuing the header function. I posted this question in the general mail 
list but have received any reponse from anyoneso

Using the script list above, follow the steps shown below to produce this problem:

1. Close all instances of your browser (I am using IE-5.01 and I have not tried any 
other browsers). However I don't believe it is a browser issue.

2. Run the script shown above.

3. Enter some user ID and password... Everything so far works fine.

4. Look in the directory where the script is stored. There should be a file called 
. This indicates that $PHP_AUTH_USER was NOT set.

5. Remove the file .

6. Refresh the browser. Look for the file . Notice that  is present; which 
should only happen if $PHP_AUTH_USER is NOT setYET "else" was printed on screen 
which indicates that $PHP_AUTH_USER IS set.

7. Uncomment the commented "header" line and notice that a user ID and password prompt 
is always issued in this case.


My questions are:

1. Why are both sides of the conditional "If (!isset($PHP_AUTH_USER))" being executed?

2. Why, when $PHP_AUTH_USER is not set, the 'exec(">")' runs on subsequent 
refreshes, but no prompt for a new user ID and password is issued?

3. Why, if a authenticate header is sent before testing, a user ID and password prompt 
is issued?




Thanks for taking a look at this.


Dean

---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10079&edit=2


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]