I want to create a comment form with CI!! |
[eluser]ngatcharius[/eluser]
hello All!! I am new in CI. I want to create a comment form in some of my web pages how will i do? because URI is look like www.exemple.com/param1/param2/param3. i need your help please!
[eluser]InsiteFX[/eluser]
Read the CodeIgniter Users Guide Form_Validation InsiteFX
[eluser]ngatcharius[/eluser]
i know how to use form in CI i will explan you my plan <here my picture> <my comment form [with captcha]> <here list of comment> $this->url = www.exemple.com/show/picture/$id_picture in view form i put current_url() in form_open() [it is good ?] 1 - went i post my form i don't see error messages 2 - i put an 'echo' in Code: if ($this->input->post('comment')) i'm waiting for your post! thanks in advance
[eluser]Djordje Zeljic[/eluser]
Code: <? Try to run this code.
[eluser]ngatcharius[/eluser]
thanks {Djordje Zeljic} it works!! you reply quickly please how to empty post if form_validation->run() is true?
[eluser]Djordje Zeljic[/eluser]
if you think how to empty $_POST? Code: unset($_POST); Code: $_POST = null;
[eluser]ngatcharius[/eluser]
after post a comment i need to empty all post of the form! that is to prevent user to repost same value!
[eluser]WanWizard[/eluser]
That doesn't really help, POST information comes from the client. If the user reloads his browser, or uses the back button and submits the form again, you'll get a new POST array with all the form values... The only safe way to prevent this is to add a token to the form, and check using a form validation rule if the token in the submitted form has been used before. If so, it's a double post. You can use that same token for CSRF protection.
[eluser]Unknown[/eluser]
Me too!i need to empty all post of the form! that is to prevent user to repost same value! |
Welcome Guest, Not a member yet? Register Sign In |