Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: session trouble

  1. #1
    New to the CF scene
    Join Date
    Jan 2003
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    session trouble

    (form name = "form", textbox = "text")

    if i want to get the data from "text" after submitted the "form"
    then, how can i save the data into a session??

    and how to call the session in another page , can u show me??

  • #2
    New Coder
    Join Date
    Jan 2003
    Location
    Tulsa, OK
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts
    When you have a form posting to a PHP script, the values in the form itself are set as variables on the posted page. I'm not sure this is what you want to know, but say you post with the field "text". Now, on the posted script you can manipulate the variable $text seeing is that was the name of the form field in the previous page.

    Sessions are a different story as far as storing data. You might want to read up on the PHP manual about that.

    http://www.php.net/manual/en/ref.session.php

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by bored
    I'm not sure this is what you want to know, but say you post with the field "text". Now, on the posted script you can manipulate the variable $text seeing is that was the name of the form field in the previous page.
    But only if the php.ini setting register_globals is set to "On". And that's no longer the case in the default php.ini distributed with PHP's 4.1 (and higher) version. Better use $_POST['text'] to get at the posted values.

  • #4
    New Coder
    Join Date
    Jan 2003
    Location
    Tulsa, OK
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts
    True. I've never had a host that left them off. But for security's sake, that is better.


  •  

    Posting Permissions

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