Re: Error when trying to get global variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Louis Young wrote:
Hi there

I've used a tool called asp2php to convert all my asp files to php files, but now in ASP you have the global.asa file. I've converted this to global.php. So now part of it looks as follows:

It actually worked? Cool!


function Application_OnStart() { extract($GLOBALS);


$Application["ConnectionString"]="PROVIDER=SQLOLEDB;DATA SOURCE=MYDB;UID=myuser;PWD=mypwd;DATABASE=mydb";


 return $function_ret;
}

Now from one of the other pages:

<?
   include "global.php";
 session_start();
 session_register("Login_session");
 session_register("Outlet_session");
 echo $Application["ConnectionString"];
?>

But I get the following warning:

*Warning*: session_start(): Cannot send session cache limiter - headers already sent (output started at C:\Program Files\Apache Group\Apache2\htdocs\spar\admin\global.php:52) in *C:\Program Files\Apache Group\Apache2\htdocs\spar\admin\login.php* on line *3

Unless you are specifically doing a header() call this is caused by sending output to stdout.



On line 52 in global.php there is nothing. This is the end of the file.

Is there a line of blank text at the end of the code? This has been known to cause this problem and while it isn't obvious from viewing your code... it's being sent as content. Or at least this is oftentimes what causes this error.



-- Teach a person to fish...

Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://www.php.net/manual/en/index.php
php-general archives: http://marc.theaimsgroup.com/?l=php-general&w=2

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux