Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

PHP session side-effect warning - how to get solve? -


i'm new php, , sure easy, i'd right way. have script:

<?php if ($_post["username"]=="") {     include($_server['document_root'] ."/login.inc.php"); } else {      $username=$_post["username"];     $password=$_post["password"];     session_start();     if ($username=="bob" , $password=="123"){ $permission="yes";}     $username=$_post["username"];     session_register("permission");        session_register("username");        if ($permission=="yes"){         // show stuff     } } ?> 

excuse funky formatting of code - can't seem show properly.

so, keep getting error:

warning: unknown: script possibly relies on session side-effect existed until php 4.2.3. please advised session extension not consider global variables source of data, unless register_globals enabled. can disable functionality , warning setting session.bug_compat_42 or session.bug_compat_warn off, respectively in unknown on line 0

which i'm assuming means need change 1 of variable names doesn't conflict session variable right? that's read, i'm not sure 1 change.

can / show me please?

thanks

osu

it happening because of

session_register("username");   

it not recommended, , deprecated of php 5.3.

if want script work regardless of register_globals, need instead use $_session array $_session entries automatically registered. if script uses session_register(), not work in environments php directive register_globals disabled.

source.

as know, register_globals terrible, , should always off.

the common way register session var $_session superglobal, i.e.

$_session['username'] = $username; 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -