PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
ol4pr0
Forum Regular
Posts: 926 Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador
Post
by ol4pr0 » Mon Mar 15, 2004 4:46 pm
Oke right to the point.
upload works nice and all that, however i want to add a mime mail after the file has been uploaded.
Code: Select all
// this is basicly how the uplaod ends as you can see.
// now how do i go about on turning this end into a automatic mime mail.
// the mime mail itself is not the problem since i already am able to do
// that.
// exept for getting the right filename that was uploaded ;-(
$endresult = "File Was Uploaded";
m3mn0n
PHP Evangelist
Posts: 3548 Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada
Post
by m3mn0n » Mon Mar 15, 2004 5:08 pm
An if() statment maybe?
Code: Select all
<?php
if ( $endresult == "File Was Uploaded" )
{
// mime mail
}
?>
ol4pr0
Forum Regular
Posts: 926 Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador
Post
by ol4pr0 » Mon Mar 15, 2004 5:24 pm
Did thought of that.. however i do not understand why this error occurs
Code: Select all
break;
case "doupload":
include "config.php";
if ( $endresult == " File Was Uploaded ")
// whole bunch of the mime...
$mime->addAttachment($file, 'text/plain');
$body = $mime->get();
$hdrs = $mime->headers($hdrs);
$mail =& Mail::factory('mail');
$mail->send('root@tms.com', $hdrs, $body);
header("location: http://10.10.10.10");
}
else {
if ($file_name == "") {
$endresult = "<font size="2">No file selected</font>";
}
Parse error upload.php on line 164
which is basicly outside the script
ol4pr0
Forum Regular
Posts: 926 Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador
Post
by ol4pr0 » Mon Mar 15, 2004 5:29 pm
new errors
Notice: Undefined variable: endresult in /usr/local/apache2/htdocs/system/upload.php on line 79
Notice: Undefined variable: endresult in /usr/local/apache2/htdocs/system/upload.php on line 140
Code: Select all
//line 79
if ( $endresult == "<font size="2" color="red">File Was Uploaded</font>") {
// line 140
<td bgcolor="#FFFFFF">
<center><font color="000000"> $file_name</font> $endresult</center> //140
</td>
ol4pr0
Forum Regular
Posts: 926 Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador
Post
by ol4pr0 » Mon Mar 15, 2004 5:34 pm
Code: Select all
// never mind..
$endresult = "";
if ($............
}else{
// and all the other .
ol4pr0
Forum Regular
Posts: 926 Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador
Post
by ol4pr0 » Mon Mar 15, 2004 5:36 pm
now the sending part lol needs some fixing guess that for tomorrow