开发者

Session values not loading on next page

开发者 https://www.devze.com 2023-01-26 07:34 出处:网络
I am binding the session values in one page - $_SESSION[\'order\'] 开发者_StackOverflow社区= $order;

I am binding the session values in one page -

$_SESSION['order'] 开发者_StackOverflow社区= $order;
$_SESSION['total'] = $gtot;

and fetching on next page-

$order = $_SESSION['order'];
$gtot = $_SESSION['total'];

...but in next next page I am getting blank session.

I have started session with session_start();

When I check session values in previous page with print_r($_SESSION['order']); I get the proper values.


Try to use session_start(); in the beginning of any code using session variables in your PHP web pages so that it works fine.

check this PHP manual url:-

http://php.net/manual/en/function.session-start.php

I hope this helps you..


You first start SESSION on your both page,

session_start();

and try. give feedback on comment.


First you have to start SESSION your both page like 'searc page' and 'search result page'

In search page just store your input value like:

<input type="text" name="name"/>
<input type="submit" value=">>"/>

In Search page store your NAME value in SESSION like:

$_SESSION['name'] = $fname;

Now, ECHO $_SESSION variable in search result page like:

<input type="text" name="name" value="<?php echo $fname ?>"/>

Hope it work simply.. if its works please tick sloved.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号