
February 10th, 2008
08:37 PM
funny and cheeky
Status: Offline!
sessions within included php scripts
I have a php called admin.php which includes a variety of php files due their complexity. I noticed if the an include files that uses sessions has been included as an url it doesn't work. But as a relative path it does.
include "checkadmin.php" works
include "http://localhost/checkadmin.php" fails
why?
Last edited by schoi, February 10th, 2008 09:29 PM (Edited 1 times)

February 12th, 2008
02:32 AM
i always thought >> include "http://localhost/checkadmin.php" fails<< includes where bad for some reason and not aloud was told by someone to use the paths rather then urls and to do something else with the paths like add a ./ or some crap so they won't be able to get into my website i don't really remember exactly what i was told but i just used the paths every since

June 6th, 2008
06:28 PM
loves kitties and cuddles
Status: Offline!
This doesn't have much to do with sessions.
Long story short, I believe using remote URLs (http:// ...) won't work unless that option is enabled in php.ini, the server's PHP configuration. Even if they were enabled, if you did so, you wouldn't get any PHP code, but straight up HTML because the page is being served through HTTP -- and the PHP parser parses the PHP code before it gets to whatever client is requesting the file.
Includes typically use filesystem paths (/var/www/htdocs/whatever.php) because the server looks locally on its own disks and doesn't go out through the interwebs to grab the file.
I strongly advise you to read: http://us2.php.net/manual/en/function.include.php
___________________
I've got a girlfriend! WOOT.
Last edited by Jeff, June 6th, 2008 06:28 PM (Edited 1 times)