1

I am binding the session values in one page -

$_SESSION['order'] = $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.

2
  • Can you post more of your code? Also, where are you calling session_start()? It should be at the top, at least before any output. Commented Nov 21, 2010 at 7:28
  • Are you calling session_start on both pages? And are the session IDs on both requests identical (just echo session_id? Commented Nov 21, 2010 at 8:28

3 Answers 3

1

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

Sign up to request clarification or add additional context in comments.

Comments

1

You first start SESSION on your both page,

session_start();

and try. give feedback on comment.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.