
ScottAllenNet
Members-
Posts
31 -
Joined
-
Last visited
Never
Everything posted by ScottAllenNet
-
Thanks. Is there anything i need to change in there in order to make the above script work?
-
This is the contents of my PHP.INI file: include_path = ".:/usr/lib/php5:/usr/share/php/libzend-framework-php:/usr/share/zend-framework" allow_url_fopen = on register_globals = on display_errors = on allow_url_include = on
-
Thanks again buddy. Just ran that: The file Internal Recruitment CV.docx has been uploaded Scott Allen mail.scottallen@gmail.com 447867616540 United Kingdom est Fatal error: Call to undefined function finfo_open() in /homepages/7/d393500880/htdocs/harrisonpearce/test/uploadtest.php on line 55 Not seen this error before :/
-
Thanks buddy. Ok so, ran that updated one. The file CV.docx has been uploaded Scott Allen mail.scottallen@gmail.com 447867616540 United Kingdom Test Fatal error: Call to undefined function mime_content_type() in /homepages/7/d393500880/htdocs/harrisonpearce/test/uploadtest.php on line 53
-
I am reading the code I asure you I was merely commenting on what the script has produced just to confirm that it falls inline with what we are trying to achieve. I am not rude enough to ignore the work you are putting in - and I really appreciate it. I am learning allot!
-
Ok, so when I run this I get the following: The file Ethics Approval Form.docx has been uploaded Scott Allen mail.scottallen@gmail.com 447867616540 United Kingdom Fatal error: Call to undefined function mime_content_type() in /homepages/7/d393500880/htdocs/harrisonpearce/test/uploadtest.php on line 39 The file upload ends up in the same directory as the php and html files in http://harrisonpearce.com/test not in the uploads folder. No email is sent.
-
I have tried a few different files and get the same error every time :/
-
I beleive the error lies with this code: $Body .= "Content-Type: ".mime_content_type($file)."; name=\"" .$target_path. "\"\r\n" . "Content-Transfer-Encoding: base64\r\n" . "Content-disposition: attachment; file=\"" .$target_path. "\"\r\n" . "\r\n" . chunk_split(base64_encode($file)); On line 68.
-
On testing the form I get this: There was an error uploading the file, please try again! Fatal error: Call to undefined function mime_content_type() in /homepages/7/d393500880/htdocs/harrisonpearce/test/uploadtest.php on line 68 http://harrisonpearce.com/test/testform.html
-
Yes - I filled out all parts of the form and tried it: See: http://www.harrisonpearce.com/submit-your-cv
-
Ok cheers dude - pulling up this error now: There was an error uploading the file, please try again! Fatal error: Call to undefined function mime_content_type() in /homepages/7/d393500880/htdocs/harrisonpearce/_layout/php/submit-cv.php on line 68
-
Ok so keep getting this error: There was an error uploading the file, please try again! Fatal error: Call to undefined function mime_content_type() in /homepages/7/d393500880/htdocs/harrisonpearce/_layout/php/submit-cv.php on line 70 I have tried smaller files etc. Really confused. I have got the uploads folder in the same place as the php file.
-
Ok so I just tried again and got this issue: There was an error uploading the file, please try again! Fatal error: Call to undefined function mime_content_type() in /homepages/7/d393500880/htdocs/harrisonpearce/_layout/php/submit-cv.php on line 70 By the way - thanks again for all of your help. Scott.
-
Ok I see. Do you know how to correct this then?
-
Thanks buddy - but it now shows this error: There was an error uploading the file, please try again! Fatal error: Call to undefined function mime_content_type() in /homepages/7/d393500880/htdocs/harrisonpearce/_layout/php/submit-cv.php on line 70
-
Thanks man! I seem to get this error though: Parse error: syntax error, unexpected T_VARIABLE in /homepages/7/d393500880/htdocs/harrisonpearce/_layout/php/submit-cv.php on line 54
-
I really appreciate your help but I think you overestimate my php abilites. I have no idea how to implement this. What I have produces really is the limit. If possible, can you explain in the simplist of terms, how to turn the following into a form that will upload and email the document along with the form: <form name="submit-cv" id="submit-cv" action="_layout/php/submit-cv.php" method="post"> <table> <tbody><tr> <td> Your Name: <font color="#DA1623">*</font><br /> <input id="name" class="text" type="text" value="" name="name"> </td> <td> Email Address: <font color="#DA1623">*</font><br /> <input id="email" class="text" type="text" value="" name="email"> </td> </tr> <tr> <td> Telephone: <font color="#DA1623">*</font><br /> <input id="telephone" class="text" type="text" value="" name="telephone"> </td> <td> Location:<br /> <input id="location" class="text" type="text" value="" name="location"> </td> </tr> <tr> <td colspan="2"> Attach CV:<br /> <input type="file" name="attachcv" id="attachcv" /> </td> </tr> <tr> <td colspan="2"> Covering Letter/Other:<br /> <textarea name="coveringletter" rows="5" cols="20"></textarea> </td> </tr> </tbody></table> <input type="submit" name="submit" value="Send Details"> </form> <?php // get posted data into local variables $EmailFrom = "website@harrisonpearce.com"; $EmailTo = "register@harrisonpearce.com"; $Subject = "New Candidate Registration"; $name = Trim(stripslashes($_POST['name'])); $email = Trim(stripslashes($_POST['email'])); $telephone = Trim(stripslashes($_POST['telephone'])); $location = Trim(stripslashes($_POST['location'])); $coveringletter = Trim(stripslashes($_POST['coveringletter'])); // validation $validationOK=true; if (Trim($name)=="") $validationOK=false; if (Trim($email)=="") $validationOK=false; if (Trim($telephone)=="") $validationOK=false; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=../../error\">"; exit; } // prepare email body text $Body = ""; $Body .= "Name: "; $Body .= $name; $Body .= "\n"; $Body .= "Email: "; $Body .= $email; $Body .= "\n"; $Body .= "Telephone: "; $Body .= $telephone; $Body .= "\n"; $Body .= "Location: "; $Body .= $location; $Body .= "\n"; $Body .= "Covering Letter: "; $Body .= $coveringletter; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); // redirect to success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=../../sent\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=../../error\">"; } ?>
-
Thanks - but each submission of the form will be sending a different document - that doesn't really help me. Perhaps this will help show the context of what I am trying to achieve: http://www.harrisonpearce.com/submit-your-cv
-
Yeah - as noted before i can confirm the file does upload successfully I just can't grasp how to attach that said file to an outgoing email and then erase the file.
-
/test/index.php
-
Thats right, it is the destination for the script to upload the file.
-
Can anyone else help?
-
Sorry: http://harrisonpearce.com/test/uploads/
-
Yep I know the location of the file and the path is /test/uploads
-
Ok so I know have a script that can upload the file but it really throws me on how to email it as an attachment??? <form enctype="multipart/form-data" action="uploader.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> Choose a file to upload: <input name="uploadedfile" type="file" /><br /> <input type="submit" value="Upload File" /> </form> <?php // Where the file is going to be placed $target_path = "uploads/"; /* Add the original filename to our target path. Result is "uploads/filename.extension" */ $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); $target_path = "uploads/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } ?>