Jump to content

Model application form


emediastudios

Recommended Posts

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.

Link to comment
Share on other sites

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

      }

    }

?>

Link to comment
Share on other sites

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

      }

    }

?>

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.