ID: 31390
User updated by: ricardomestre at oninetspeed dot pt
Reported By: ricardomestre at oninetspeed dot pt
Status: Bogus
Bug Type: Unknown/Other Function
Operating System: NT
PHP Version: Irrelevant
New Comment:
I just noticed that the included page doesnt read normal vars or even
session vars.
for instance:
Page test.php
<?php
$sib = 'yes';
if($sib == 'yes') {
for($i = 1; $i <= 3; $i++) {
include
'http://www.pmexpresso.com/database/code.php?page=1';
}
}
?>
Page code.php
<?php
if($sib == 'yes') {
print "You can see the code<br>";
} else {
print "You must login first<br>";
}
?>
the result is:
You must login first
You must login first
You must login first
Previous Comments:
------------------------------------------------------------------------
[2005-01-05 22:30:48] [EMAIL PROTECTED]
Read the common pitfals at:
http://php.net/set_cookie
------------------------------------------------------------------------
[2005-01-05 22:11:55] ricardomestre at oninetspeed dot pt
I dont want to be boring but... I am searching everywhere and noone can
help me :S... i tried the chat.. forums etc....
The try many things but it doesnt work :S
Why doesnt it work? its pretty weird because i guess the code is well
done...
I guess even if its small.. its a bug... because the language doesnt do
what is supposed...
------------------------------------------------------------------------
[2005-01-03 21:11:42] [EMAIL PROTECTED]
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.
Thank you for your interest in PHP.
.
------------------------------------------------------------------------
[2005-01-03 17:20:11] ricardomestre at oninetspeed dot pt
Description:
------------
Hello all,
Im sorry if this thread is repeated or even if its not a bug, but i
searched a lot and no one could help me...
Here's the situation, i am trying to do a print page, and instead of
printing a page one by one, i thought it would be best to have all the
pages in one.
My code its pretty complex and specific so i made two simple pages with
similar sctructure to see what happens.
Reproduce code:
---------------
Page test.php
<?php
setcookie("loged","yes",time()+3600, '', '.domain.com'); ###this
setcookie its just to save time when testing, but it doesnt affect the
final result...
if($_COOKIE['loged'] == 'yes') {
for($i = 1; $i <= 3; $i++) {
include
'http://www.domain.com/database/code.php?page=1';
}
}
?>
Page code.php
<?php
if($_COOKIE['loged'] == 'yes') {
print "You can see the code<br>";
} else {
print "You must login first<br>";
}
?>
Expected result:
----------------
I'd expect to see:
You can see the code
You can see the code
You can see the code
Because the cookie is set...
Actual result:
--------------
Page test.php
The cookie is set,
it checks it just to prove that its well set,
to include the page 3 times the 'for',
the include with full link because of the args.
Page code.php
Cookie test fails... $_COOKIE['loged'] returns nothing.
and so the final result is:
You must login first
You must login first
You must login first
final note: Accessing code.php directly works fine. With include
doesn't... :/
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31390&edit=1