ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I read several other Google places, they said: a) This could not be done. b) This was not the way to do this but gave no alternative.
Then I found this which seems reasonable.
I'm not sure it's all that reasonable to trust data being (re-)posted from a hidden input in a form. Wouldn't it mean that someone could post a form to do_whatever.php with an "id" value of their choosing and cause all kinds of trouble, including overwriting date generated by another session, or ever worse, gain access to data from another (perhaps authenticated) session?
(Disclaimer: Yes, I've done exactly this to fool a web application into believing I had a valid session when in fact I did not. I am not responsible for any legal trouble anybody may get into should they choose to do something similar.)
If the idea is simply to generate a unique temporary file, wouldn't using tempnam be a better and safer approach?
If the idea is simply to generate a unique temporary file, wouldn't using tempnam be a better and safer approach?
I did not find how many entities tempnam can have in existence at one time. Would 2000 plus be unrealistic? How many unique file names could it produce in 1 second?
What I want to do:
a) Person comes to website, Enters date, city, state, which is sent via a 'form action' to a function.
b) Function sends to another function which, creates a 'unique file name' and sends this 'unique file name' along with 'date, city, state' to another file.
c) Another file searches for the closest 50 towns to 'city, state', writes them to 'unique file name' pre-pending the date.
d) A search function uses the information created by 'Another file' to search a large data base for matches.
Printed to the screen, it might look something like this.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.