• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Example for form_open() in php

#1
[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..

#2
[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-gui...elper.html

Hope the above helps you.

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

#4
[eluser]danmontgomery[/eluser]
(http://ellislab.com/codeigniter/user-gui...elper.html)

#5
[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();

?>


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.