proper mvc way of posting data to a form. |
[eluser]Patrick Spence[/eluser]
[quote author="chubbypama" date="1337628336"][quote author="WanWizard" date="1337362157"]In general you never update data through the URI, doesn't matter if you're using GET variables or URI segments. You post data through HTTP POST, and don't process it until after proper validation.[/quote] thanks for the post/response. here's another question then. i have a script that is going to be running on a box and will need to send data to my page every couple of minutes. in my old version, i just had the script use a url like: http://myserver/mysite/?var1=123&var2=123 etc. i guess i'll have to see if i can do a http post from the script.... as far as the web page is concerned then, i would just code it as if i had a form, and the form was posted... is this correct?[/quote] Yes, just like a form. Checking $this->input->post('varname', TRUE); You can use Curl to POST to pages, so if it is a shell script you can deal with the change in method fairly easily. Here is one example of why you should not change data on a GET, only POST http://thedailywtf.com/Articles/The_Spider_of_Doom.aspx If you want to get plucky and more advanced on how you handle events like your update, Phil Sturgeon made a couple nice libraries for CI, https://github.com/philsturgeon/codeigniter-restserver https://github.com/philsturgeon/codeigniter-restclient For example, I have a mail server application running on a host that handles sending all the emails out for all my domains, and each domain sends the emails to the central server with a rest PUT command. |
Messages In This Thread |
proper mvc way of posting data to a form. - by El Forum - 05-18-2012, 08:48 AM
proper mvc way of posting data to a form. - by El Forum - 05-18-2012, 09:56 AM
proper mvc way of posting data to a form. - by El Forum - 05-18-2012, 10:29 AM
proper mvc way of posting data to a form. - by El Forum - 05-18-2012, 10:59 AM
proper mvc way of posting data to a form. - by El Forum - 05-21-2012, 12:25 PM
proper mvc way of posting data to a form. - by El Forum - 05-22-2012, 02:51 PM
|