Jump to content

Recommended Posts

I have a session

<?php
session_start();
$DisTotal = $row_rsUser['Percent'];
$_SESSION["DisTotal"] = $DisTotal; 
?>

 

this does not work

 

if I do this:

<?php
session_start();
$DisTotal = 117.5;
$_SESSION["DisTotal"] = $DisTotal; 
?>

 

but this does? Can any one see what I have done wrong?

 

 

Link to comment
https://forums.phpfreaks.com/topic/53838-can-not-read-session/
Share on other sites

I get this

 

Array

(

    [Name] => Rob Farrell

    [HouseNo] => 00

    [street] => Nowhere rd

    [Town] => China

    [County] => Staffordshire

    [PostCode] => SB2 3YY

    [Tel] => 01453000000

    [Mobile] => 0772000000

    [Pref] => Yes

    [DisCode] => RF

    => rob@brown-stone.net

    [Password] => *****

    [Percent] => 117.5

)

Link to comment
https://forums.phpfreaks.com/topic/53838-can-not-read-session/#findComment-266155
Share on other sites

Still cant work this one out can any one see what I am doing wrong?

 

<?php
session_start();
$DisTotal = $row_rsUser['Percent'];
$_SESSION["DisTotal"] = $DisTotal;
?>

 

It is not picking up the percentage? I can trow the data on the page and it diaplays as 17.5 but when I try and use the above session it does not?

Link to comment
https://forums.phpfreaks.com/topic/53838-can-not-read-session/#findComment-267537
Share on other sites

Unless you defined the $row_rsUser in that test page it will not work.

 

<?php
$row_rsUser['Percent'] = 117.5
session_start();
$DisTotal = $row_rsUser['Percent'];
$_SESSION["DisTotal"] = $DisTotal;
?>

 

Even with test pages you need to have test data, as I bet if you did this:

 

<?php
//$row_rsUser['percent'] = 117.5
//session_start();
//$DisTotal = $row_rsUser['Percent'];
//$_SESSION["DisTotal"] = $DisTotal;
echo '<pre>',print_r($row_rsUser),'</pre>';
?>

 

You would not have any data printed to the screen as $row_rsUser has not been defined yet.

 

If it is being defined, post more relevant code.

Link to comment
https://forums.phpfreaks.com/topic/53838-can-not-read-session/#findComment-267549
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.