SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist achintya's Avatar
    Join Date
    Apr 2005
    Location
    Chandannagar(India)
    Posts
    459
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    SESSION array not working

    Hi guys,
    I have learned about the use session from you guys but when I am trying to use it in the following code,it is not working as I need. My code is trying to save a variable value in session array but I am not getting the value that I have saved in another php file. I have saved a value in the upload.php like this
    PHP Code:
    session_start();
    $_SESSION['url']=$url
    Now I am accessing this value in another page just like this
    PHP Code:
    session_start();
    $_SESSION['url']=$u
    But $u seems have no value. Why ? can someone explain it?

  2. #2
    Dinah-Moe Humm mudshark's Avatar
    Join Date
    Dec 2003
    Posts
    1,072
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you want to pass the session value of url to $u, you'd have to do it the other way around:

    PHP Code:
    session_start(); 
    $u $_SESSION['url']; 

  3. #3
    SitePoint Evangelist achintya's Avatar
    Join Date
    Apr 2005
    Location
    Chandannagar(India)
    Posts
    459
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    thanks guys. after using your correction,code is working as I have wanted it.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •