Jump to content

PHP5 Sesseion Problem.


php-hp

Recommended Posts

Hi,

 

I have updated my server from php4.1 to php5.

Everything was grand until i noticed that my scripts using session_register was not holding the registered values.

 

Sample code from php4.1

***************************

<?php

session_start();

session_register("exprmt");

?>

***************************

Before any html headers are sent out!

 

And calling back using

***************************

<option value="exprmt" selected><? echo $exprmt; ?></option>

***************************

 

Worked fine in php4.1 with globals on "Internal server".

 

Have tried

***************************

<?php

session_start();

$_SESSION['exprmt'] - ' ';

?>

 

***************************

and calling back using

 

***************************

<option value="exprmt" selected><? echo $_SESSION['exprmt']  ?></option>

***************************

 

But still doesnt hold the value!

 

The page is calling itself using php_self

 

Any Ideas????

 

Cheers..........

 

 

Link to comment
Share on other sites

For your second set of code that you tried, turn on full php error reporting and then check your web server log file for any errors.

 

If that code is on one single page, it should work if the session is starting (unless the code in the short open <? tag is not being parsed by php and is simply showing up in the view source of the page in your browser.)

 

Beyond this, you would need to post your code to get specific help. For example $PHP_SELF is dependent on register globals and your page might or might not work depending on how it is being used.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.