Jump to content

Include() not working cannot link to external files


celblock

Recommended Posts

I am trying to set my db connection in another file and folder than my main index.php.

When i include the db connection in the index.php everything works fine. but when i uses include ("include/config.php");

all that happens is the php code gets displayed.

 

I have one script where this function actually works, but every other script i have ever tried to use has this problem where i can not use inlcude to link to an external file

 

Is their something wrong with my php.ini config

it looks like this

 

<?php

include ("include/config.php");

session_start();

include ("include/function.php");

?>

 

 

 

session declaration should always be on the topmost of the page right before <? or else youll get a warning message saying something about header etc..

and can we see the code for  include ("include/config.php");

session declaration should always be on the topmost of the page right before <? or else youll get a warning message saying something about header etc..

and can we see the code for  include ("include/config.php");

 

Err, if you placed the call to session_start() before the php opening tag, then it wouldn't be parsed. It would be useless. I assume you mean just after the opening tag.

 

Either, way, its not true. It must simply come before any headers are sent or the $_SESSION array is used.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.