pixeltrace Posted February 18, 2007 Share Posted February 18, 2007 guys, i need help, i am currently developing a job portal and there's a page wherein job seeking or applicants needs to upload there picture and resume. is there anyone here who have made a job portal already? i dont have any idea on how to develop the form for this. i need tips for this. hope you guys can help me with this. thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/39027-need-help-on-form-file-attachment/ Share on other sites More sharing options...
JJohnsenDK Posted February 18, 2007 Share Posted February 18, 2007 do you just want a form where users can upload there picture? Quote Link to comment https://forums.phpfreaks.com/topic/39027-need-help-on-form-file-attachment/#findComment-187953 Share on other sites More sharing options...
pixeltrace Posted February 18, 2007 Author Share Posted February 18, 2007 form where they can upload the picture and resume then the resume will be saved in a specific folder into the server. let say "resumes" and have the filename renamed let say from myresume.doc to jobID001.doc is this possible? thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/39027-need-help-on-form-file-attachment/#findComment-187966 Share on other sites More sharing options...
JJohnsenDK Posted February 18, 2007 Share Posted February 18, 2007 yes it is possible.. i just need to know if you know how to make the file upload form your self or? In the mather of chancing the document name you could use preg_replace() function... Quote Link to comment https://forums.phpfreaks.com/topic/39027-need-help-on-form-file-attachment/#findComment-187973 Share on other sites More sharing options...
pixeltrace Posted February 18, 2007 Author Share Posted February 18, 2007 actually i dont have any idea and i haven't tried it yet the last form that i did was just a sendmail form wherein the fields are just text field, text area and radio buttons with regards to attachment i haven't tried yet and i dont know how. hope you could help me with this. thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/39027-need-help-on-form-file-attachment/#findComment-188023 Share on other sites More sharing options...
pixeltrace Posted February 18, 2007 Author Share Posted February 18, 2007 assuming this is my form page <form target="submit.php" method="post"> <table width="733" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="116"> </td> <td width="617"> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td>name * </td> <td><input name="name" type="text" id="name" /> </td> </tr> <tr> <td>gender</td> <td><input name="gender" type="text" id="gender" /></td> </tr> <tr> <td>date of birth </td> <td><input name="bdate" type="text" id="bdate" /></td> </tr> <tr> <td>email address * </td> <td><input name="email" type="text" id="email" /></td> </tr> <tr> <td>contact number * </td> <td><input name="cnumber" type="text" id="cnumber" /></td> </tr> <tr> <td>nationality</td> <td><input name="nationality" type="text" id="nationality" /></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td>current salary * </td> <td><input name="csalary" type="text" id="csalary" /></td> </tr> <tr> <td>expected salary * </td> <td><input name="esalary" type="text" id="esalary" /></td> </tr> <tr> <td>notice period * </td> <td><input name="nperiod" type="text" id="nperiod" /></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td>attach photo </td> <td><input name="photo" type="file" id="photo" /> * picture should not exceed 100KB </td> </tr> <tr> <td>attach resume </td> <td><input name="resume" type="file" id="resume"></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td>Text Resume </td> <td> </td> </tr> <tr> <td> </td> <td><textarea name="textresume" cols="100" rows="120"></textarea></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> </table></form> what should my submit.php codes be? and assuming all resumes will be save inside "resume" folder. hope you could help me with this. Thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/39027-need-help-on-form-file-attachment/#findComment-188037 Share on other sites More sharing options...
pixeltrace Posted February 18, 2007 Author Share Posted February 18, 2007 any update on this one? thanks! ??? Quote Link to comment https://forums.phpfreaks.com/topic/39027-need-help-on-form-file-attachment/#findComment-188100 Share on other sites More sharing options...
skali Posted February 18, 2007 Share Posted February 18, 2007 Hi, You will have to make your file form to this format and provide enctype attribute just as i have provided below. and a field of file type, this is the field through which actual uploading will take place. <form action="submit.php" method="post" enctype="multipart/form-data"> <input name="resume" type="file" /> <input type = "submit" value="submit"> </form> and you can add all your required fields in this form. on the page where you will submit your form. add the code below //set this to the directory where files will be uploaed $uploaddir = '/home/test/resumes'; $uploadfile = $uploaddir . basename($_FILES['resume']['name']); if (move_uploaded_file($_FILES['resume']['tmp_name'], $uploadfile)) { echo "File is uploaded."; } else { echo "File could not be uploaded"; } Quote Link to comment https://forums.phpfreaks.com/topic/39027-need-help-on-form-file-attachment/#findComment-188107 Share on other sites More sharing options...
pixeltrace Posted February 18, 2007 Author Share Posted February 18, 2007 hi, thanks for the help, with regards to my previous question also, how will i rename the resume file in the submit php page? ex. myresume.doc to jobID000101.doc thanks! Quote Link to comment https://forums.phpfreaks.com/topic/39027-need-help-on-form-file-attachment/#findComment-188114 Share on other sites More sharing options...
skali Posted February 18, 2007 Share Posted February 18, 2007 You can use the $uploadfile variable to any name that you want in the code below. And this will be the name of the file which will be saved on the server. $uploadfile = $uploaddir . basename($_FILES['resume']['name']); if (move_uploaded_file($_FILES['resume']['tmp_name'], $uploadfile)) { echo "File is uploaded."; } else { echo "File could not be uploaded"; } Quote Link to comment https://forums.phpfreaks.com/topic/39027-need-help-on-form-file-attachment/#findComment-188118 Share on other sites More sharing options...
pixeltrace Posted February 18, 2007 Author Share Posted February 18, 2007 thanks skali! i'll try this out. Quote Link to comment https://forums.phpfreaks.com/topic/39027-need-help-on-form-file-attachment/#findComment-188125 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.