Welcome Guest, Not a member yet? Register   Sign In
Newbie: upload helper tutorial / adding more fields
#1

[eluser]loopymonkey[/eluser]
http://ellislab.com/codeigniter/user-gui...ading.html

I'm able to follow along and create a page that submits a file which is fantastic, but very simply how can i, using the same code as a base, add a text input field called username and then on the form success page show the data collected with that username at top?
#2

[eluser]ejangi[/eluser]
As per the user-guide, in the Controller method that "catches" the request (i.e. where you're dealing with your file-upload stuff and displaying a view after the submit) you can do this:
Code:
function upload()
{
    $data['username'] = $this->input->post('username');
    $this->load->view('success', $data);
}

and in the view (success.php):
Code:
<p>Hello &lt;?php echo $username; ?&gt;</p>
<p>You have successfully uploaded a file!</p>
#3

[eluser]loopymonkey[/eluser]
thanks, that worked! I'm still trying to wrap my head around the php difference with ci. I need to page through that userguide.




Theme © iAndrew 2016 - Forum software by © MyBB