Jump to content

need help on form file attachment


pixeltrace

Recommended Posts

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!

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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";

}

 

 

 

Link to comment
Share on other sites

 

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";

}

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.