HTML help

11/13/2013 02:37 LordGragen.#1
hey guys so my contact form have all this futures.

[Only registered and activated users can see links. Click Here To Register...]

and now i want to add one more future. i can also upload a file from my desktop to contact form and when i click send it send everything to my email.


here is the code.

[Only registered and activated users can see links. Click Here To Register...]

any help will be nice.


note:

just made a simple one. what do you guys think.

<div>
<form method='POST' enctype='multipart/form-data' action='fup.cgi'>
File to upload: <input type=file name=upfile><br>
<br>
</form>
<div>
11/13/2013 10:46 Ravenstorm#2
At first you should set your code in a post form cause as you said you want to send a mail with this informations.
After this you can add a input for the Upload wrote a short code for it.
PHP Code:
Upload:<input type="file" name="file">
<input type="submit" name="send" value="Submit">

<?php
if($_POST['send']){
   
move_uploaded_file($_FILES['file']['tmp_name'],$to);
}
?>
Thats the code for moving your file to add it to a mail you should take a look at "phpMailer".

After this you can take a simple code for adding the file as an attachment
PHP Code:
    //Data-Path
    
$fileName $_FILES['file']['name'];
    
$filePath $_FILES['file']['tmpname'];
    
    
$mail->AddAttachment($filePath$fileName); 
11/16/2013 10:50 atef201080#3
but careful and hide the uploaded files location from the visitors since anyone can upload shells :)