Page 1 of 1

if $file was uploaded.

Posted: Mon Mar 15, 2004 4:46 pm
by ol4pr0
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";

Posted: Mon Mar 15, 2004 5:08 pm
by m3mn0n
An if() statment maybe?

Code: Select all

<?php

if ( $endresult == "File Was Uploaded" )
{

    // mime mail

}
?>

Posted: Mon Mar 15, 2004 5:24 pm
by ol4pr0
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

Code: Select all

</html>";
break;
}

?> line 163

Posted: Mon Mar 15, 2004 5:29 pm
by ol4pr0

Code: Select all

//fixedbreak 
}
}
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>

Posted: Mon Mar 15, 2004 5:34 pm
by ol4pr0

Code: Select all

// never mind.. 

$endresult = "";
if ($............
}else{
// and all the other .

Posted: Mon Mar 15, 2004 5:36 pm
by ol4pr0
now the sending part lol needs some fixing guess that for tomorrow