Welcome Guest, Not a member yet? Register   Sign In
Form to database
#2

[eluser]weblyan[/eluser]
No, only one form tag can be posted from one page to another. You need to put all the input tags in the same form tag.
Code:
<form action="" method="post">
CSR Number: &lt;input type="text" name="csrnumber"&gt;&lt;br><br>

Severity:
&lt;input type="radio" name="severity" value="high"&gt;High &nbsp;&nbsp;
&lt;input type="radio" name="severity" value="medium"&gt;Medium &nbsp;&nbsp;
&lt;input type="radio" name="severity" value="low"&gt;Low &nbsp;&nbsp;
&lt;input type="radio" name="severity" value="other"&gt;Other<br><br>
&lt;/form&gt;

The action attribute in the form should be the target url, the url to where the form will be sent

Then in the controller or model, you will handle the data sent by the form.
If you are not using a framework then you would access the input data like this $severity = $_POST['severity'].
But in Codeigniter you will access the data using $severity = $this->input->post('severity');

To get the data into the database, look at this: http://ellislab.com/codeigniter/user-gui...index.html


Messages In This Thread
Form to database - by El Forum - 06-29-2012, 04:36 AM
Form to database - by El Forum - 06-29-2012, 05:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB