Call uploaded PHP file.
guys guys..
i have this problem.. here's the case:
1) Form in HTML includes a Attachment file.
2) Upon submit, it goes into Preview page in PHP.
3) After confirming the data user click on submit again which will then send out the information to the intended person mailbox by another PHP file.
Now question, how do i add the Attachment into the mail at step 3?
I can however do so if there isn't step 2.
i have this problem.. here's the case:
1) Form in HTML includes a Attachment file.
2) Upon submit, it goes into Preview page in PHP.
3) After confirming the data user click on submit again which will then send out the information to the intended person mailbox by another PHP file.
Now question, how do i add the Attachment into the mail at step 3?
I can however do so if there isn't step 2.
0
Comments
Step 2 PHP code included the below:
<?php session_start(); ?>
<?php
$_SESSION = 5;
?>
?php $target_path = "uploads/"; $target_path = $target_path . basename( $_FILES); $_FILES; ?>
<?php $target_path = "uploads/"; $target_path = $target_path . basename( $_FILES); $_FILES; ?>
Step 3 PHP code
$fp = fopen($target_path, "rb"); //Open it
$data = fread($fp, filesize($target_path)); //Read it
$data = chunk_split(base64_encode($data)); //Chunk it up and encode it as base64 so it can emailed
fclose($fp);
tested but still not working..
I don't mean to be rude, but I get the impression you need to work on you basic PHP chops before getting too much further. Check out the PHP books on my recommended reading list.
i managed to resolved it. using the below code out..
[PHP]<?php
$uploaded_dir = "uploads/";
$filename = $_FILES["attachment"]["name"];
$path = $uploaded_dir . $filename; print "Temporary name: " . $_FILES . "<br>";
print "Original name: $filename<br>";
print "Destination: $path<br>"; if (move_uploaded_file($_FILES["attachment"]["tmp_name"], $path)) {
print "Uploaded file moved";
// do something with the file here
} else {
print "Move failed";
}
?>[/PHP]
followed by:
[PHP]<?php session_start();
$_SESSION=$path;
$_SESSION=$filename;
?>[/PHP]
at first i made a stupid mistake of adding ' at the start and end of session settings. done with it and thanks.