Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Sessions...

  1. #11
    Join Date
    Jan 2007
    Location
    The stage
    Posts
    568
    Thanks
    23
    Thanked 6 Times in 6 Posts

    Default

    I name them input# because its just easier to do that later on and plus its really easy to copy and paste instead of having to type in the name of the input...
    Though I have no idea how to do loops so if anyone could help me that would be spectacular!!!
    All i need is for the session data to either turn back into variables or for it to be able to be written into a file... i just don't know how to do that process...
    heres as far as i got before i'm stumpped...
    Code:
    $_SESSION['input1'] = $_POST['input1'];
    $_SESSION['input2'] = $_POST['input2'];
    $_SESSION['input3'] = $_POST['input3'];
    $_SESSION['input4'] = $_POST['input4'];
    $_SESSION['input5'] = $_POST['input5'];
    $_SESSION['input6'] = $_POST['input6'];
    $_SESSION['input7'] = $_POST['input7'];
    $_SESSION['input8'] = $_POST['input8'];
    $_SESSION['input9'] = $_POST['input9'];
    $_SESSION['input10'] = $_POST['input10'];

  2. #12
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I name them input# because its just easier to do that later on and plus its really easy to copy and paste instead of having to type in the name of the input...
    If you find yourself copying and pasting code in any language, you're doing something wrong.
    Though I have no idea how to do loops so if anyone could help me that would be spectacular!!!
    I just wrote it for you!
    All i need is for the session data to either turn back into variables or for it to be able to be written into a file
    You can access the data in the page where you need to access it as e.g. $_SESSION['input1'].
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #13
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    Quote Originally Posted by Twey View Post
    Though I have no idea how to do loops so if anyone could help me that would be spectacular!!!
    I just wrote it for you!
    Me thinks you are blind

    Quote Originally Posted by Twey View Post
    Code:
    foreach($_POST as $k => $v)
      $_SESSION[$k] = $v;

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
  •