Posted: Fri Mar 18, 2005 8:37 am
the value in the element will be an integer, not a string. != will make it work.. or using 0 instead of '0'
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
$name = $_POST['name'];
if (isset($_POST['enter_data'])) {
if ($_FILES['fnt']['size'] != '0') {
$name_short = stripslashes(substr($_POST['name'], 0, 5));
$extension = strrchr($_FILES['fnt']['name'], ".");
$filename = $name_short."_".date("d.m.y").$extension;
$filename = str_replace(" ", "", $filename);
move_uploaded_file($_FILES['fnt']['tmp_name'], "../images/ads/".$filename);
$resource = mysql_query("INSERT into sponsors (name, website, description, type, pic) VALUES ('$name', '$website', '$description', '$type', '$filename')") or die(mysql_error()); }
else {
$resource = mysql_query("INSERT into sponsors (name, website, description, type, pic) VALUES ('$name', '$website', '$description', '$type', 'n')") or die(mysql_error()); }
MYSQL_CLOSE();
echo"<META HTTP-EQUIV=refresh content=0;URL=index.php>";
}