Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8562385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:43:08+00:00 2026-06-11T16:43:08+00:00

I have created a php session and have assigned data like so session_start(); $_SESSION[‘desd’]=$imgD;

  • 0

I have created a php session and have assigned data like so

session_start();
$_SESSION['desd']=$imgD;

When i try to retrieve it on other page i get nothing.

this is what i have done on second page,

session_start();
$_imgname = $_SESSION['desd'];

How to do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T16:43:09+00:00Added an answer on June 11, 2026 at 4:43 pm

    The code is valid, assuming that the variable $imgD is defined (var_dump is one way of checking this, but print or echo may also work).

    Check to ensure that cookies are enable in your browser.

    Also, be sure that session_start() comes near the top of your script, it should be the first thing sent to the client each time.

    To test a session, create “index.php” with the following code:

    <?php
      session_start();  
      if(isset($_SESSION['views']))
          $_SESSION['views'] = $_SESSION['views']+ 1;
      else
          $_SESSION['views'] = 1;
    
      echo "views = " . $_SESSION['views']; 
    ?>
    

    Reload the page several times and you should see an incrementing number.

    An example of passing session variables between two pages is as follows:

    PageOne.php

     <?php 
       session_start(); 
    
       // makes an array 
       $colors=array('red', 'yellow', 'blue'); 
       // adds it to our session 
       $_SESSION['color']=$colors; 
       $_SESSION['size']='small'; 
       $_SESSION['shape']='round'; 
       print "Done";
     ?> 
    

    PageTwo.php

    <?php 
     session_start(); 
     print_r ($_SESSION);
     echo "<p>";
    
     //echo a single entry from the array
     echo $_SESSION['color'][2];
    ?>
    

    For simplicity put PageOne.php and PageTwo.php in the same directory. Call PageOne.php and then PageTwo.php.

    Try also tutorials here, here, and here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a php/mysql based chat page.It is like gmail chat.once i click
I have created a php table like so: echo <table border = '0' cellpadding
I have the session created and it stores the data, that is working 100%;
I have a very simple script that creates a user: <?php include 'mysqlserver.php'; session_start();
I have created PHP GD image for captcha, file called image.php each time it
I am noob with php so pardon my ignorance. I have created php form
I have created a PHP script and I am lacking to extract the primary
I have created a PHP code to echo the following div <div id=main_catsel> <select
I have created a PHP form which requires the user to select a postcode
How to manually create Friendly URLs? (PHP) So I have created simple php file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.