Как загрузить резюме на php и сохранить его на фодере.
Привет,
Это мой код, я получаю какую-то ошибку, может ли кто-нибудь помочь мне в этом вопросе.
<?php session_start(); $job_title=''; $first_name=''; $last_name=''; $email=''; $current_company=''; $mobile=''; //$resume=''; if($_SESSION['security_code'] == $_POST['security_code'] && !empty($_SESSION['security_code']) ) { if( isset($_POST['Submit'])) { $job_title=$_POST['job_title']; $first_name=$_POST['first_name']; $last_name=$_POST['last_name']; $email=$_POST['email']; $current_company=$_POST['current_company']; $mobile=$_POST['mobile']; //$resume=$_FILES['resume']; //$resume=($_FILES['resume']['first_name']); $date=date("Y-m-d"." "."h:i:s"); $date1=date("Ymdhis"); //This is the directory where images will be saved $docc=($_FILES['resume']['name']); $doc =$date1.str_replace(' ','',$docc); $target = "resumes/"; $target = $target.basename($doc); //This gets all the other information from the form $name=$_POST['first_name']; //Tells you if its all ok if(move_uploaded_file($_FILES['resume']['tmp_name'],$target)) { echo "The file ". basename( $_FILES['resume']['first_name']). " has been uploaded, and your information has been added to the directory".$date." ".$date1."<br/>"; } } else { echo "sorry no data uploaded"; } } else{echo "No data found Pls reselect";} ?>
<form action="<?php echo $_SERVER['PHP_SELF'];?>" name="WebToLeadForm" method="post" id="WebToLeadForm" onsubmit="javascript: return form_validation();" > <tr> <td colspan="2" class="required" style="height: 14px"><strong>Please fill this form:</strong> <span class="required" style="color:#64a34f;">* marked Fields are compulsory.</span></td> </tr> <tr> <td >Job Title<span class="required" style="color:#64a34f;">*</span>: </td> <td ><span sugar="slot"> <input id="job_title" name="job_title" type="text" style="width:150px;" value="<?php echo htmlentities($job_title) ?>" /> </span> </td> </tr> <tr> <td width="48%" >First Name<span class="required" style="color:#64a34f;">*</span>:</td> <td width="52%" ><input id="first_name" name="first_name" type="text" style="width:150px;" value="<?php echo htmlentities($first_name) ?>" /> </td> </tr> <tr> <td width="48%" >Last Name<span class="required" style="color:#64a34f;">*</span>:</td> <td width="52%" ><input id="last_name" name="last_name" type="text" style="width:150px;" value="<?php echo htmlentities($last_name)?>" /> </td> </tr> <tr> <td >Email Address<span class="required" style="color:#64a34f;">*</span> : </td> <td ><input id="email" name="email" type="text" style="width:150px;" value="<?php echo htmlentities($email) ?>" /> </td> </tr> <tr> <td ><span sugar="slot">Current Company Name</span> <span class="required" style="color:#64a34f;">*</span>: </td> <td ><span sugar="slot"> <input id="current_company" name="current_company" type="text" style="width:150px;" value="<?php echo htmlentities($current_company) ?>"/> </span> </td> </tr> <tr> <td >Contact Number<span class="required" style="color:#64a34f;">*</span>: </td> <td ><span sugar="slot"> <input id="mobile" name="mobile" type="text" style="width:150px;" value="<?php echo htmlentities($mobile) ?>" /> </span> </td> </tr> <tr> <td >Upload your Resume <span class="required" style="color:#64a34f;">*</span>:</td> <td valign="top"> <input name="resume" id="resume" type="file" style="width:180px;"/> </td> </tr> <tr> <td height="30" valign="top" > </td> <td valign="top"><img id="imgid" name="img" src="CaptchaSecurityImages.php?width=100&height=40&characters=5" /> </td> </tr> <tr> <td height="30" valign="top" ><small>Can't read the image?</small> </td> <td valign="top">click <a href='javascript: refreshCaptcha();'><small>here</small></a><small> to refresh</small> </td> </tr> <tr> <td height="30" valign="top" >Security Code:<span class="required" style="color:#93B928;">*</span></td> <td valign="top"><input id="security_code" name="security_code" type="text" style="width:100px;"/></td> </tr> <tr> <td height="30" valign="top" > </td> <td valign="top"><input class="button" name="Submit" value="Send" type="submit" /></td> </tr> </form> </table>
Ошибка, которую я получаю
1-неопределенный индекс: резюме в C:\wamp\www\MySQL\careers.php на линии 29
2-неопределенный индекс: резюме в C:\wamp\www\MySQL\careers.php на линии 38
заранее спасибо