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 - Can't hold session values -


i have written code login page , user page. when user provides correct username , password, code creates session variable rid , redirects user user page.

but facing weird problem, session variable remains in login page when code redirects user page says notice: undefined variable: _session in /var/www/avatar/test1.php on line 6.

just check if session working tries output $_session['rid'] on both pages, displays rid on login page, on user page above error.

so have created 2 sample pages test.php , test1.php. creating session variable in test.php , trying display in in test1.php.

test.php :

<?php      $result=session_start();      $_session["searock"]="searock";      echo $result;      echo $_session["searock"]; ?> <html>      <body>           <a href="test1.php">next</a>      </body> </html> 

output :

1 searock next

test1.php :

<?php     echo $_session["searock"]; ?> 

output :

notice: undefined variable: _session in /var/www/avatar/test1.php on line 2

i don't know whether problem in code or in php enviroment variables.

heres screen shot of phpinfo. alt text

can point me in right direction ?

thanks.

unless session.auto_start enabled, need call session_start explicitly on every page want session available.

so call session_start in test1.php , check whether $_session["searock"] exists before accessing it:

<?php     session_start();     if (isset($_session["searock"])) {         echo $_session["searock"];     } ?> 

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 -