require_once question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jamie
Forum Newbie
Posts: 7
Joined: Sun Nov 23, 2003 11:41 pm

require_once question

Post by jamie »

My webhost has been messing about with the PHP server side and scripts that have been running great for months have suddenly ground to a halt - a clear case of messing with something that wasn't broken.

Anyway, after a weekend of them looking at the problems the server was having and fixing them, the problem has now come back to me to fix, as all my php files need to be updated.

I didn't put a session_save_path() before session_start() in any of the files. This command seems to be sadly lacking much exposure and I missed it when learning PHP from a book. So I now need to wade through all these files and update them.

My question - all my files have a require_once('connections.php') statement somewhere in the first few lines. If I also include in connections.php the lines session_save_path(); and session_start(); will that work?

Also, in session_save_path([path]), if the path is left blank, am I correct in thinking that the server just defaults to something?

Thanks
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

My webhost has been messing about with the PHP server side and scripts that have been running great for months have suddenly ground to a halt - a clear case of messing with something that wasn't broken
LOL

anyways, as far as sessions and includes i'd say go for it. i see no reason why it wouldn't work at least..
Post Reply