#21312 [Fbk->Opn]: session_register doesnt like null values

From: Date: Fri, 03 Jan 2003 16:38:27 +0000
Subject: #21312 [Fbk->Opn]: session_register doesnt like null values
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-28994@lists.php.net to get a copy of this message
ID: 21312 User updated by: charlesk@netgaintechnology.com Reported By: charlesk@netgaintechnology.com -Status: Feedback +Status: Open Bug Type: Session related Operating System: Windows 2000 Server PHP Version: 4.3.0 New Comment: Tryed that and still the same results. Previous Comments: ------------------------------------------------------------------------ [2003-01-03 10:22:52] rasmus@php.net Try adding this to your php.ini file: session.bug_compat_42 = 1 session.bug_compat_warn = 0 ------------------------------------------------------------------------ [2003-01-01 12:19:47] phpbug@dpits.de i've the same problem with linux (apache 1.3.27) + mysql. contents of nearly all variable are exchanged! with a small function i had fixed this temporarly: function dp_session_register($variable) { global ${$variable}; if(is_null(${$variable})) ${$variable}=""; return session_register($variable); } i hope, this will fixed as soon as posible. thanks. daniel prior ------------------------------------------------------------------------ [2002-12-31 08:59:20] charlesk@netgaintechnology.com <?php session_start(); $source = $_SERVER["HTTP_REFERER"]; session_register("source"); $connection = mssql_connect('server','UserName','password'); $sql = "select * from tbl;"; echo "$sql $connection<br>"; $sql_result = mssql_query($sql,$connection); $num = mssql_num_rows($sql_result); $retVal = "Records = ".$num; if ($num > 0) { mssql_data_seek($sql_result,0); $row = mssql_fetch_object($sql_result); $retVal = $row->Text; } mssql_free_result($sql_result); echo $retVal; ?> In this case the mssql_query fails with: PHP Warning: mssql_query(): supplied argument is not a valid MS SQL-Link resource. if I simply comment the $source = $_SERVER... it succeeds. If I change session_register to $_SESSION["source"] = $source; it succeeds. I am not sure how these are related. What is even weirder is the echo "$sql $connection<br>"; They echo what is expected when it works. When it doesnt whichever was defined first is the value for both. IE When it fails as it is written select * from tbl_Texts; select * from tbl_Texts; If you change $connection = mssql_connect('server','UserName','password'); $sql = "select * from tbl;"; to $sql = "select * from tbl;"; $connection = mssql_connect('server','UserName','password'); it echos Resource id #3 Resource id #3 I will in the future use $_SESSION but there are alot of files to change if this wont be fixed. Thanks Charles Killmer ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=21312&edit=1

« previous php.bugs (#28994) next »