CodeIgniter Forums
Example for form_open() in php - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Example for form_open() in php (/showthread.php?tid=31825)



Example for form_open() in php - El Forum - 07-02-2010

[eluser]Joviac[/eluser]
Hi everyone,
I am newer to php.I need to use form_open() in my php program,so please reply your answer for my request..


Example for form_open() in php - El Forum - 07-03-2010

[eluser]psp83[/eluser]
Hi Joviac.

Here's how you use the form_open().

Code:
<?php

// load the form helper so you can use set_value, form_open etc
$this->load->helper('form');

echo form_open('location/to/sumbit/to');

echo "Username : ". form_input('username', set_value('username'));
echo "Password : ". form_password('password', set_value('password'));
echo form_submit('submit', 'Login');

echo form_close();

?>

The above form is just a basic form, you can read more about the form helper here : http://ellislab.com/codeigniter/user-guide/helpers/form_helper.html

Hope the above helps you.


Example for form_open() in php - El Forum - 07-06-2010

[eluser]Joviac[/eluser]
Hi paulparadise
Thank u very much...its working


Example for form_open() in php - El Forum - 07-06-2010

[eluser]danmontgomery[/eluser]
(http://ellislab.com/codeigniter/user-guide/helpers/form_helper.html)


Example for form_open() in php - El Forum - 07-15-2012

[eluser]shahnawazahmed[/eluser]
hello psp , why we use this code to create forms in php ? we can also do this in Html forms .
<?php
echo form_open('location/to/sumbit/to');
echo "Username : ". form_input('username', set_value('username'));
echo "Password : ". form_password('password', set_value('password'));
echo form_submit('submit', 'Login');

echo form_close();

?>