hellow friends, I ran into a little problem <~~ noobie in php..
I got 2 file to be upload from a form. First one is calle "fileatt" and the second is called "fileatt2". This is the code im trying to test.
<?php
if ((empty ($fileatt)) && (empty ($fileatt2))
{
include ("form_get.php");
print "only form was sent";
exit;
}
elseif (!empty ($fileatt)) && (empty ($fileatt2))
{
include ("form_get.php");
include ("img_attach.php");
print "only form and image was sent";
exit;
}
elseif (empty ($fileatt)) && (!empty ($fileatt)))
{
include ("form_get.php");
include ("text_attach.php");
print "only form and essay was sent";
exit;
}
else {
include ("img_attach.php");
include ("text_attach.php");
include ("form_get.php");
print "all was sent";
exit;
}
?><?php
if ((empty ($fileatt)) && (empty ($fileatt2)))
{
include ("form_get.php");
print "only form was sent";
exit;
}
elseif ((!empty ($fileatt)) && (empty ($fileatt2)))
{
include ("form_get.php");
include ("img_attach.php");
print "only form and image was sent";
exit;
}
elseif ((empty ($fileatt)) && (!empty ($fileatt)))
{
include ("form_get.php");
include ("text_attach.php");
print "only form and essay was sent";
exit;
}
else {
include ("img_attach.php");
include ("text_attach.php");
include ("form_get.php");
print "all was sent";
exit;
}
?>
as u can see first IF suppose to check if both upload fields are empty then process the form only. 2nd ELSEIF check if "fileatt" is NOT EMPTY meaning sumtin is there while "fileatt2" is empty then process then send the image attachment to an email. 3rd ELSEIF does the opposite of the 2nd ELSEIF. then lastly, if both fields are NOT EMPTY then process both files then send to email and also process form...
Please help me!!! I've been workin on this for 4 hours n looping myself in circle.