Results 1 to 9 of 9

Thread: Alternative for system()

  1. #1
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default Alternative for system()

    Hi,
    I need to put a text file on my users computer; sort of like a temporary cookie. The problem is, that I can't use system().
    This is what I'm doing:
    -A user logs in
    -a file is saved on the user's computer: including the name the user logged in with, and some other data
    -the data is then used on different pages, to give the user more options, etc.
    -the file is removed
    - Mike

  2. #2
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    You could never do that with system(). You have to use cookies.

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Or sessions, if you want it to be temporary (only for that session... single time at your site without closing the window or going to a different page that doesn't continue the session.)

    Likely cookies, though.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #4
    Join Date
    Sep 2006
    Location
    Eureka, California
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Mike,

    What you are wanting to do goes against every coding doctrine that has ever existed in the PHP world, and just about every other C2C (client to customer) system that has ever existed.

    If you cannot do it server-side, (the two suggestions mentioned above) don't do it.

  5. #5
    Join Date
    Aug 2006
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Mike,

    John is right; if you can't save that "file"(session or cookie) in your server's computer then you can't do it! If on the other hand you can do it server-side, a good tutorial(actually, there's some free chapters of a book) for session-security can be found at www.sitepoint.com/books! (Search for "PHP Anthology" book; if however you have any problem just give your email and I'll send it to you)!

    Hope I Helped!!


    Costas

  6. #6
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    I think I'll try to learn how to use cookies... this is really starting to bug me though
    - Mike

  7. #7
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Okay. Problem solved, thanks alot
    - Mike

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

    Default

    Sessions are much easier than cookies, and generally more secure, too.
    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!

  9. #9
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Yeah, probably. But I couldn't understand sessions: I tried to figure out how to use them but couldn't, so I tried cookies, and I figured out those. My problem is solved so it doesn't really matter now, thanks anyway though
    - Mike

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
  •