Help pls.Forms validation with file upload - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Help pls.Forms validation with file upload (/showthread.php?tid=60753) |
Help pls.Forms validation with file upload - El Forum - 06-20-2014 [eluser]svlada5[/eluser] Here is my problem , i wanna submit form with text, and pics, but in form_open() i cant handle two methods for form_validation and file_upload in same time. How also i can implement form_open_multypart() and helper to upload files, when i already got login/create function to handle my form validation <?php echo form_open("login/create" );?> <div class="form-group"> <label for="exampleInputPassword1">Ime:</label> <input type="name" class="form-control " id="name" placeholder="Vaše ime" name="name" value="<?php set_value('name'); ?>"> </div> <div class="form-group"> <label for="exampleInputEmail1">Prezime:</label> <input type="name" class="form-control" id="exampleInputEmail1" placeholder="Vaše prezime" name="lastname"value="<?php set_value('lastname'); ?>"> </div> <div class="form-group"> <label for="exampleInputEmail1">Korisničko ime:</label> <input type="name" class="form-control" id="exampleInputEmail1" placeholder="korisnsičko ime" name="username"value="<?php set_value('username'); ?>"> </div> <div class="form-group"> <label for="exampleInputPassword1">Šifra:</label> <input type="password" class="form-control" id="exampleInputPassword1" name="password" placeholder="Šifra"> </div> <div class="form-group"> <label for="exampleInputPassword1">Potvrdite šifru:</label> <input type="password" class="form-control" id="exampleInputPassword1" name="password1" placeholder="Potvrdite šifru"> </div> <div class="form-group"> <label for="exampleInputPassword1">Odaberite sliku</label> <input type="file" class="form-control" id="slika" name="password1" placeholder="Potvrdite šifru"> </div> <button type="submit" class="btn btn-primary">Kreiraj nalog</button> <?php echo form_close();?> Help pls.Forms validation with file upload - El Forum - 06-20-2014 [eluser]treenef[/eluser] What I do in my controller is check if file is uploaded first then do a form validation on the data fields so... Code: if form upload == true |