emediastudios Posted August 20, 2010 Share Posted August 20, 2010 Hi Everyone. I am in need of assistance, I need a form that i will use on a model agency site i am making, the form i have only has the option to upload one image and records name, age etc... What i need is a form that will upload multiple images, 2 will do but if i had a option to add more that would be great, and a pdf resume, does anyone have a similar form i can have a look at that does this, any help be awesome, i am already over the deadline. Quote Link to comment https://forums.phpfreaks.com/topic/211270-model-application-form/ Share on other sites More sharing options...
Wolphie Posted August 20, 2010 Share Posted August 20, 2010 http://www.devarticles.com/c/a/PHP/Creating-a-MultiFile-Upload-Script-in-PHP/ Quote Link to comment https://forums.phpfreaks.com/topic/211270-model-application-form/#findComment-1101588 Share on other sites More sharing options...
emediastudios Posted August 20, 2010 Author Share Posted August 20, 2010 Thanks, i read that. Still didn't help, i kind of need one that will upload 2 images and a pdf, as well as put the record in the database, i have name, age, phone ect to go in the form too, thanks anyway Quote Link to comment https://forums.phpfreaks.com/topic/211270-model-application-form/#findComment-1101598 Share on other sites More sharing options...
trq Posted August 20, 2010 Share Posted August 20, 2010 Sounds like your fishing for someone to write the code for you instead of learning from examples. That's not the point of this board. Post your request in the freelance board after you've read the stickies. Quote Link to comment https://forums.phpfreaks.com/topic/211270-model-application-form/#findComment-1101607 Share on other sites More sharing options...
emediastudios Posted August 20, 2010 Author Share Posted August 20, 2010 This what i have, i just need help getting the second image to upload. I am unsure how to do it and have battled for hours. I am sure there is a problem with the mysql insert too. <?php if($ps != "2"){ ?> <FORM ENCTYPE="multipart/form-data" ACTION="admin.php?p=addProductItem&ps=2" METHOD="POST"> <table width="66%" border="0" cellspacing="0" cellpadding="5"> <tr> <td width="26%" align="left" valign="top">First name</td> <td width="74%" align="left" valign="top"> <input name="first" type = "text" size="40" /> </td> </tr> <tr> <td align="left" valign="top">Last name:</td> <td align="left" valign="top"><input name="last" type = "text" size="40" id="last" /></td> </tr> <tr> <td align="left" valign="top">Age:</td> <td align="left" valign="top"><input name="age" type = "text" size="40" id="age" /></td> </tr> <tr> <td align="left" valign="top">Email:</td> <td align="left" valign="top"><input name="email" type = "text" size="40" id="email" /></td> </tr> <tr> <td align="left" valign="top">Phone:</td> <td align="left" valign="top"><input name="phone" type = "text" size="40" id="phone" /></td> </tr> <tr> <td align="left" valign="top">A bit about you:</td> <td align="left" valign="top"><textarea name="content" cols="60" rows="10"></textarea></td> </tr> <tr> <td align="left" valign="top">Image:</td> <td align="left" valign="top"> <input name="userfile" type="file" /> </td> </tr> <tr> <td align="left" valign="top">Image:</td> <td align="left" valign="top"><input name="userfile2" type="file" /></td> </tr> <tr> <td align="left" valign="top"> <input type="submit" value="submit" /> </td> <td align="left" valign="top"></td> </tr> <tr> <td align="left" valign="top"> </td> <td align="left" valign="top"> </td> </tr> </table> <br> </FORM> <?php } else{ $add="uploaded/".$_FILES[userfile][name]; $add2 = "../".$add; if(move_uploaded_file ($_FILES[userfile][tmp_name], $add2)){ $Q = mysql_query("INSERT INTO productitem (`first`,`last`,`age`,`email`,`phone`,`content`,`phone`,`content`,`file`,`file2`) VALUES ('$first','$last','$age','$email','$phone','$content','$add','$add')"); echo "Added Successfully"; } else{ echo "Add Failed"; } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/211270-model-application-form/#findComment-1101609 Share on other sites More sharing options...
emediastudios Posted August 20, 2010 Author Share Posted August 20, 2010 I changed it to this, but is still wrong, im hopeless. <FORM ENCTYPE="multipart/form-data" ACTION="model_application.php" METHOD="POST"> <table width="66%" border="0" cellspacing="0" cellpadding="5"> <tr> <td width="26%" align="left" valign="top">First name</td> <td width="74%" align="left" valign="top"> <input name="first" type = "text" size="40" /> </td> </tr> <tr> <td align="left" valign="top">Last name:</td> <td align="left" valign="top"><input name="last" type = "text" size="40" id="last" /></td> </tr> <tr> <td align="left" valign="top">Age:</td> <td align="left" valign="top"><input name="age" type = "text" size="40" id="age" /></td> </tr> <tr> <td align="left" valign="top">Email:</td> <td align="left" valign="top"><input name="email" type = "text" size="40" id="email" /></td> </tr> <tr> <td align="left" valign="top">Phone:</td> <td align="left" valign="top"><input name="phone" type = "text" size="40" id="phone" /></td> </tr> <tr> <td align="left" valign="top">A bit about you:</td> <td align="left" valign="top"><textarea name="content" cols="60" rows="10"></textarea></td> </tr> <tr> <td align="left" valign="top">Image:</td> <td align="left" valign="top"> <input name="userfile" type="file" /> </td> </tr> <tr> <td align="left" valign="top">Image:</td> <td align="left" valign="top"><input name="userfile2" type="file" /></td> </tr> <tr> <td align="left" valign="top"> <input type="submit" value="submit" /> </td> <td align="left" valign="top"></td> </tr> <tr> <td align="left" valign="top"> </td> <td align="left" valign="top"> </td> </tr> </table> <br> </FORM> <?php if(isset($_POST['submit'])){ $add="uploaded/".$_FILES[userfile][name]; $add2="uploaded/".$_FILES[userfile2][name]; if(move_uploaded_file ($_FILES[userfile][tmp_name])){ $Q = mysql_query("INSERT INTO applicants (`first`,`last`,`age`,`email`,`phone`,`content`,`phone`,`content`,`file`,`file2`) VALUES ('$first','$last','$age','$email','$phone','$content','$add','$add2')"); echo "Added Successfully"; } else{ echo "Add Failed"; } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/211270-model-application-form/#findComment-1101616 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.