PHP beginner |
|
Oke,
Ik heb nu dit:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Nieuwe pagina</title>
</head>
<body>
<?php
include("../inc/inc.php");
if(isset($_FILES['bestand']))
{
if($_FILES['bestand']['size'] > $max_size)
{
echo 'Het bestand is '.$_FILES['bestand']['size'].' bytes, het maximale wat toegestaan is, is: '.$max_size.' bytes.';
}
elseif($_FILES['bestand']['type'] == $bt)
{
if(empty($_POST['dir']))
{
echo 'Geen map geselecteer.';
}
elseif(empty($_POST['filename']))
{
echo 'Geen filename ingevult!';
}
elseif(!is_dir('../'.$_POST['dir'].''))
{
mkdir('../'.$_POST['dir'], '0777');
move_uploaded_file($_FILES['bestand']['tmp_name'], "../".$_POST['dir']."/".$_FILES['bestand']['name']."");
}
elseif(is_dir('../'.$_POST['dir'].''))
{
move_uploaded_file($_FILES['bestand']['tmp_name'], "../".$_POST['dir']."/".$_FILES['bestand']['name']."");
}
}
else
{
echo 'Exstensie niet toegelaten.';
}
}
else
{
echo 'Selecteer een bestand.';
}
?>
<FORM ACTION="" METHOD="post" ENCTYPE="multipart/form-data">
File: <INPUT TYPE="file" NAME="bestand"><BR />
Map: <input type="text" name="dir" /><br />
Filenaam(zonder .php)<input type="text" name="filename" /><br />
<INPUT TYPE="submit" NAME="submit" VALUE="Upload">
</FORM>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Nieuwe pagina</title> </head> <body> <?php include("../inc/inc.php"); if(isset($_FILES['bestand'])) { if($_FILES['bestand']['size'] > $max_size) { echo 'Het bestand is '.$_FILES['bestand']['size'].' bytes, het maximale wat toegestaan is, is: '.$max_size.' bytes.'; } elseif($_FILES['bestand']['type'] == $bt) { { echo 'Geen map geselecteer.'; } elseif(empty($_POST['filename'])) { echo 'Geen filename ingevult!'; } elseif(!is_dir('../'.$_POST['dir'].'')) { mkdir('../'.$_POST['dir'], '0777'); move_uploaded_file($_FILES['bestand']['tmp_name'], "../".$_POST['dir']."/".$_FILES['bestand']['name'].""); } elseif(is_dir('../'.$_POST['dir'].'')) { move_uploaded_file($_FILES['bestand']['tmp_name'], "../".$_POST['dir']."/".$_FILES['bestand']['name'].""); } } else { echo 'Exstensie niet toegelaten.'; } } else { echo 'Selecteer een bestand.'; } ?> <FORM ACTION="" METHOD="post" ENCTYPE="multipart/form-data"> File: <INPUT TYPE="file" NAME="bestand"><BR /> Map: <input type="text" name="dir" /><br /> Filenaam(zonder .php)<input type="text" name="filename" /><br /> <INPUT TYPE="submit" NAME="submit" VALUE="Upload"> </FORM> </body> </html>
Maar, hij upload niet veel.. sterker nog, hij maakt de mappen niet aan, hoe komt dit?
Alvast bedankt |