Register | Login | |||||
Main
| Memberlist
| Active users
| ACS
| Commons
| Calendar
| Online users Ranks | FAQ | Color Chart | Photo album | IRC Chat |
| |
0 user currently in Programming. | 3 guests |
Acmlm's Board - I2 Archive - Programming - PHP: Online Memory | | | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread |
User | Post | ||
SyntaxLegend Double metal axe Level: 25 Posts: 155/222 EXP: 78264 For next: 11356 Since: 04-21-04 From: Australia Since last post: 20 days Last activity: 10 hours |
| ||
How does one make a memory sort of thing in PHP, like submiting something and then make it go into a buffer sort of thing without it actually going into the Database? | |||
neotransotaku Baby Mario 戻れたら、 誰も気が付く Level: 87 Posts: 2709/4016 EXP: 6220548 For next: 172226 Since: 03-15-04 From: Outside of Time/Space Since last post: 11 hours Last activity: 1 hour |
| ||
what do you mean by not having it enter the database? if you don't call mysql functions in PHP, it never will enter the database. If you want data to remain through continous php processing, then just save your data inside the $_SESSION variable. | |||
SyntaxLegend Double metal axe Level: 25 Posts: 156/222 EXP: 78264 For next: 11356 Since: 04-21-04 From: Australia Since last post: 20 days Last activity: 10 hours |
| ||
I want it to enter the database after all the changes have been made. eg. i have an option i submit it, then submit another, and another. Then i clikc the finalize button, and then it inserts all of the options into the database. |
|||
Ramsus Octoballoon Level: 19 Posts: 30/162 EXP: 34651 For next: 1126 Since: 01-24-05 From: United States Since last post: 39 days Last activity: 71 days |
| ||
Using a memory buffer that's shared between different views of the script as you described is nearly impossible due to the stateless nature of HTTP. If it's just a small amount of data, you can use a cookie to hold the information until it's finalized. That's what most shopping cart systems do. Or as someone else mentioned, you can use PHP sessions, which is even easier (and PHP hides the data on the server as long as the session is alive, instead of storing it in a cookie). You can also consider using Javascript to dynamically add form fields until the user submits all of the options. |
|||
SyntaxLegend Double metal axe Level: 25 Posts: 157/222 EXP: 78264 For next: 11356 Since: 04-21-04 From: Australia Since last post: 20 days Last activity: 10 hours |
| ||
I tihnk the session holds it for too long, i want it similar to Acmlms poll system. | |||
Narf Hi Tuvai! (reregistering while banned) Level: 16 Posts: 66/100 EXP: 17634 For next: 2622 Since: 12-26-04 Since last post: 22 hours Last activity: 14 hours |
| ||
If you have a form, use <input type="hidden" name="name_of_data" value="value_of_data" /> to process 'preset' data. Basically, it's like a text input type, but one that already has data/a value and the user can't change it Of yeah, and using cookies is a quick and dirty solution for this, but we DON'T WANT INSECURE SCRIPTS, RIGHT?! On a side note, it is suspicious that you don't know about this while you programmed your own forum, which has various forms using the hidden input type. *rolls eyes* (edited by Narf on 03-19-05 04:51 PM) |
|||
neotransotaku Baby Mario 戻れたら、 誰も気が付く Level: 87 Posts: 2713/4016 EXP: 6220548 For next: 172226 Since: 03-15-04 From: Outside of Time/Space Since last post: 11 hours Last activity: 1 hour |
| ||
Originally posted by The PunisherWhen you are sure you don't need it, you can always clobber it out of the session by setting that index of the $_SESSION to "" |
|||
SyntaxLegend Double metal axe Level: 25 Posts: 158/222 EXP: 78264 For next: 11356 Since: 04-21-04 From: Australia Since last post: 20 days Last activity: 10 hours |
| ||
Originally posted by NarfI know how to use the hidden form type, but i didnt know how to make so i can come back again, do some more and come back again. etc. |
|||
neotransotaku Baby Mario 戻れたら、 誰も気が付く Level: 87 Posts: 2716/4016 EXP: 6220548 For next: 172226 Since: 03-15-04 From: Outside of Time/Space Since last post: 11 hours Last activity: 1 hour |
| ||
all you have to do is insert more hidden fields--however, there is no clean way to do it unless you have a hidden field for each of the forum fields? | |||
Ramsus Octoballoon Level: 19 Posts: 32/162 EXP: 34651 For next: 1126 Since: 01-24-05 From: United States Since last post: 39 days Last activity: 71 days |
| ||
Originally posted by Narf I don't see how hidden form fields are more secure, considering you have to be just as careful with them as with cookies. They're just as easy to change, since all information that supposedly comes from the browser can be faked very easily using even generic tools such as curl. (edited by Ramsus on 03-20-05 05:20 AM) |
|||
Narf Hi Tuvai! (reregistering while banned) Level: 16 Posts: 67/100 EXP: 17634 For next: 2622 Since: 12-26-04 Since last post: 22 hours Last activity: 14 hours |
| ||
I'm not saying hidden input types are completely secure, but they are at least more secure than cookies. All one has to do to edit cookie files are edit one simple text file which is right on their computer, while a hidden input is harder to manipulate. | |||
Ramsus Octoballoon Level: 19 Posts: 34/162 EXP: 34651 For next: 1126 Since: 01-24-05 From: United States Since last post: 39 days Last activity: 71 days |
| ||
And I can save the form, edit the HTML, and hit submit in my browser. You can also easily encode information placed in cookies (and forms) to make tampering harder, but that's leading down the wrong path anyway. Not that it's not a good idea, but it's not how you should go about looking at security. Security comes in knowing not to trust information that comes from the user in the first place. If the user is in control of sending any information that can easily pose a security risk or lets them choose options they shouldn't have access to, then something's wrong with the basic design of your script. It doesn't matter how hard it is to tamper with the information they send, but merely that they can send it. Telling someone that avoiding cookies makes their script more secure merely distracts them from the real problems, like plugging data straight into SQL servers or simply calling include(); on whatever string happens to be in a certain $_GET variable. @The Punisher: PHP sessions don't have to last indefinitely. Just use session_start(); while working with the form, then use $_SESSION = array(); and session_destroy(); after the form has been submitted. (edited by Ramsus on 03-20-05 07:15 AM) (edited by Ramsus on 03-20-05 07:18 AM) |
|||
SyntaxLegend Double metal axe Level: 25 Posts: 159/222 EXP: 78264 For next: 11356 Since: 04-21-04 From: Australia Since last post: 20 days Last activity: 10 hours |
| ||
well i figured it out in none of the ways you people suggested. Thanks for the offers though. I got it by using arrays. |
|||
neotransotaku Baby Mario 戻れたら、 誰も気が付く Level: 87 Posts: 2722/4016 EXP: 6220548 For next: 172226 Since: 03-15-04 From: Outside of Time/Space Since last post: 11 hours Last activity: 1 hour |
| ||
I'm curious to know how you use arrays to do what you wanted to do... and I didn't really understand the scope of your problem, could you explain? |
|||
Darth Coby Vire Dacht je nou echt dat het over was? Dacht je nou echt dat ik gebroken was? Nee toch? Nou kijk eens goed op uit je ogen gast. zonder clic heb je geen kloten tjap... bitch Level: 55 Posts: 1139/1371 EXP: 1240774 For next: 73415 Since: 03-15-04 From: Belgium Since last post: 2 days Last activity: 9 hours |
| ||
Wait, wasn't he just asking how to use queries? | |||
SyntaxLegend Double metal axe Level: 25 Posts: 160/222 EXP: 78264 For next: 11356 Since: 04-21-04 From: Australia Since last post: 20 days Last activity: 10 hours |
| ||
Originally posted by neotransotaku i used the for technique for($o=1; $_POST['options'][$o];$o++){ |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread |
Acmlm's Board - I2 Archive - Programming - PHP: Online Memory | | | |