PDA

View Full Version : Alternative for system()



mburt
10-22-2006, 11:40 PM
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

blm126
10-22-2006, 11:49 PM
You could never do that with system(). You have to use cookies.

djr33
10-23-2006, 12:54 AM
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.

AbelaJohnB
10-23-2006, 04:55 AM
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.

costas
10-23-2006, 07:17 AM
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

mburt
10-23-2006, 10:21 PM
I think I'll try to learn how to use cookies... this is really starting to bug me though :)

mburt
10-23-2006, 10:54 PM
Okay. Problem solved, thanks alot :)

Twey
10-23-2006, 11:20 PM
Sessions are much easier than cookies, and generally more secure, too.

mburt
10-23-2006, 11:55 PM
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 :)