upload formulier
11 antwoorden
Gesponsorde links
Chupskie - 20/01/2007 18:46
MySQL beginner
Hallo Blatennnn,
Krijg je foutmeldingen, errors, enz?
Of is het alleen de submit button die niet werkt? (zie ik in je voorbeeld)?
Zonder bijhorende code, kunnen we zoiezo, heel moeilijk iets voor je doen? Dus als je je vraag iets duidelijker wil formuleren, incl. bijhorende code, en alle foutmeldingen die je krijgt of niet krijgt.
-Chupskie
blatennnn - 20/01/2007 19:08 (laatste wijziging 20/01/2007 19:09)
Nieuw lid
euh ja sorry
ik krijg geen foutcode, als ik op uploaden druk gebeurt er gewoon niks dus idd die submit button.
code :
$config['map'] = "/var/www/vhosts/hetlaarhof.be/subdomains/maarten/httpdocs/shared/"; //aanpassen
function upload_size( $size, $maxm="100000000000000000000000" ) { //maxm wijzigen
if( $size > $maxm ) {
error( 'Je file is te groot!' );
}
}
function error( $error, $exit=TRUE ) {
echo $error;
if( $exit == TRUE ) {
exit;
}
}
function bestaat_al( $naam ) {
if( file_exists( $naam ) ) {
error( 'De file-naam bestaat al/Of je hebt niets ingevuld!' );
}
}
if( isset($_POST['uploaden']) ) {
upload_size( $_FILES['upload']['size'] );
bestaat_al( $config['map'] . $_FILES['upload']['name'] );
move_uploaded_file( $_FILES['upload']['tmp_name'], $config['map'] . $_FILES['upload']['name'] );
echo 'Je plaatje is geupload!<br>
<a href="uploads/'.$_FILES['upload']['name'].'">Zie je file</a>';
} else {
?>
<form method="post" enctype="multipart/form-data" name="upload">
<table>
<tr>
<td>File:</td>
<td><input type="file" name="upload" id="upload"></td>
</tr>
<tr>
<td>Upload:</td>
<td><input type="submit" name="uploaden" value="uploaden"></td>
</tr>
</table>
</form>
<?
}
$config['map'] = "/var/www/vhosts/hetlaarhof.be/subdomains/maarten/httpdocs/shared/"; //aanpassen
function upload_size( $size, $maxm="100000000000000000000000" ) { //maxm wijzigen
if( $size > $maxm ) {
error( 'Je file is te groot!' );
}
}
function error( $error, $exit=TRUE ) {
echo $error;
if( $exit == TRUE ) {
exit;
}
}
function bestaat_al( $naam ) {
if( file_exists( $naam ) ) {
error( 'De file-naam bestaat al/Of je hebt niets ingevuld!' );
}
}
if( isset($_POST['uploaden']) ) {
upload_size( $_FILES['upload']['size'] );
bestaat_al( $config['map'] . $_FILES['upload']['name'] );
move_uploaded_file( $_FILES['upload']['tmp_name'], $config['map'] . $_FILES['upload']['name'] );
echo 'Je plaatje is geupload!<br>
<a href="uploads/'.$_FILES['upload']['name'].'">Zie je file</a>';
} else {
?>
<form method="post" enctype="multipart/form-data" name="upload">
<table>
<tr>
<td>File:</td>
<td><input type="file" name="upload" id="upload"></td>
</tr>
<tr>
<td>Upload:</td>
<td><input type="submit" name="uploaden" value="uploaden"></td>
</tr>
</table>
</form>
<?
}
Chupskie - 20/01/2007 19:15
MySQL beginner
Je mist een action in je <form>
verander dit:
<form method="post" enctype="multipart/form-data" name="upload">
< form method= "post" enctype= "multipart/form-data" name= "upload" >
eens naar dit
<form method="post" enctype="multipart/form-data" name="upload" action="index.php">
< form method= "post" enctype= "multipart/form-data" name= "upload" action= "index.php" >
(ps. wijzig eventueel index.php naar de naam van jou eigen pagina, waarin je deze code zet)
Succes
-Chupskie
TotempaaltJ - 20/01/2007 19:15
PHP interesse
ik zou ergens dit script inplakken, zodat je de indexof.php niet ziet:
if(substr($file, 0, 1) == "indexof") continue;
if ( substr ( $file , 0 , 1 ) == "indexof" ) continue ;
't Is maar een tip! Owjah, $file is de naam van 'het' te laden bestand!
Chupskie - 20/01/2007 19:52
MySQL beginner
Wat is je code nu, want ik zie in je voorbeeld, dat je een parse error krijgt?
blatennnn - 20/01/2007 20:00
Nieuw lid
$config['map'] = "/var/www/vhosts/hetlaarhof.be/subdomains/maarten/httpdocs/shared/"; //aanpassen
function upload_size( $size, $maxm="100000000000000000000000" ) { //maxm wijzigen
if( $size > $maxm ) {
error( 'Je file is te groot!' );
}
}
function error( $error, $exit=TRUE ) {
echo $error;
if( $exit == TRUE ) {
exit;
}
}
function bestaat_al( $naam ) {
if( file_exists( $naam ) ) {
error( 'De file-naam bestaat al/Of je hebt niets ingevuld!' );
}
}
if( isset($_POST['uploaden']) ) {
upload_size( $_FILES['upload']['size'] );
bestaat_al( $config['map'] . $_FILES['upload']['name'] );
move_uploaded_file( $_FILES['upload']['tmp_name'], $config['map'] . $_FILES['upload']['name'] );
echo 'Je plaatje is geupload!<br>
<a href="shared/'.$_FILES['upload']['name'].'">Zie je file</a>';
} else {
?>
<form method="post" enctype="multipart/form-data" name="upload" action="index.php">
<table>
<tr>
<td>File:</td>
<td><input type="file" name="upload" id="upload"></td>
</tr>
<tr>
<td>Upload:</td>
<td><input type="submit" name="uploaden" value="uploaden"></td>
</tr>
</table>
</form>
<?
}
$config['map'] = "/var/www/vhosts/hetlaarhof.be/subdomains/maarten/httpdocs/shared/"; //aanpassen
function upload_size( $size, $maxm="100000000000000000000000" ) { //maxm wijzigen
if( $size > $maxm ) {
error( 'Je file is te groot!' );
}
}
function error( $error, $exit=TRUE ) {
echo $error;
if( $exit == TRUE ) {
exit;
}
}
function bestaat_al( $naam ) {
if( file_exists( $naam ) ) {
error( 'De file-naam bestaat al/Of je hebt niets ingevuld!' );
}
}
if( isset($_POST['uploaden']) ) {
upload_size( $_FILES['upload']['size'] );
bestaat_al( $config['map'] . $_FILES['upload']['name'] );
move_uploaded_file( $_FILES['upload']['tmp_name'], $config['map'] . $_FILES['upload']['name'] );
echo 'Je plaatje is geupload!<br>
<a href="shared/'.$_FILES['upload']['name'].'">Zie je file</a>';
} else {
?>
<form method="post" enctype="multipart/form-data" name="upload" action="index.php">
<table>
<tr>
<td>File:</td>
<td><input type="file" name="upload" id="upload"></td>
</tr>
<tr>
<td>Upload:</td>
<td><input type="submit" name="uploaden" value="uploaden"></td>
</tr>
</table>
</form>
<?
}
kwam wrs omdat ik zelf ook wat bezig ben / mosen
Berten - 20/01/2007 20:27
PHP beginner
Ik denk niet dat dat het probleem is, maar je form en je fileinput hebben dezelfde naam. Het is zowieso beter om dit te vermijden.
Kr4nKz1n - 21/01/2007 11:17 (laatste wijziging 21/01/2007 11:19)
Onbekend
Gebruik eens <? bovenaan je coding.
-Edit-
Typo
blatennnn - 21/01/2007 11:44 (laatste wijziging 21/01/2007 11:50)
Nieuw lid
die stond op een andere lijn waar blijkbar een > ontbrak en het werkr nu wel bedankt allen
http://maarten.hetlaarhof.be/shared / als je naar deze linkt gaat via ie dan geeft hij een kadertje zolas een missing image maar dat is helemaal geen image . in firefox werkt het toch tenminsten iemand idee? code is volgende
<?php error_reporting(E_ALL);
if(IsSet($_GET['i']))
{
$i = trim($_GET['i']);
$img['img'] = "R0lGODlhEAAQAPcAAP//////AP8A//8AAAD//wD/AAAA/wAAAPuBhP0RI7Crrr24vL25vn+CmJ6syZ6rxbfF4cbO3srO1oOk4WF4oo6fvpyuzqCvyqKxzKGwy6i30qa10KKxy6Oxy6Kwyb3M57G/2JyovqCswsTR6dDd9crW7NPe8tXg89Hb7uLs/uLr/Njh8eHp9wBe9YaZuYiauYeYtZWmw5mqxqCvyKi30KSyysXW8p+rvqu3ysPQ5tvo/eDr/dzm9uLs/OTt/Njg7eDn8+vy/gxn7Ku92LvO68TQ4uPu/t7p+c/Y5tXe7Nfg7cvb8ejw++vw9+fs87LD2OHu/lem/vH3/lSp/uTx/vP5/snj9+33/qGoqPz+/v3+/lXSYAC1AH3GdS6qHnDIW1OmL+Hp173JqoGaKby9srurRv3slf7dbf7cc/7Xb/7QZ/3SdP7FVd6wUP7LaP6/SP68SeS7cv6vMP62QNycN+CoTN2nTfvt1fueGf6qL/6vN/6xOf65V+C/jP2XEv6eGvmeH/6gI/6iJOCSKM+WR9OZSvjEff6ZG8mCKrB/RNifWv2EAPeAAf6IAuR5BP6JCP6QEMuMSNKTTeC7kbBhEKxdEL9rFqlfFa5iGMR0I45aJsuQVNikcNuugNG8pvLk1v17AO1zAKlUBq5XCL5kE7NiFqBdHplZHrVuLr97PcB/Q690PbF9T9CYY9KujN25l6NJAJtKA5JFBIZKF5NnQcqcdKaGbLVQAK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bm8wlolEEvMUOuQ8AcVgdQwhVYJUJgALLhwnIAABjY6NJQAKLxsnHQADmZqZJAAJLxknGgAFpaalIwAILxcnFgAGsbKxIgAHLilbERAPDg0MCwoJCAcwLTErLS/LzM0vLStCKSrU1dYqQkEAOw==";
$img['<x>'] = "R0lGODlhDQAQANUAAL60urm203d3wXd3wMHB2sTG4ra5xL/K2MHO2b/N1bzM1MHP1r/O1b7N1LbKzrvN0L7Q0ZacnHh8fLq+vp6hoYqMjLu9vX1+fmRlZfz9/ez19MHIx/H49+n08uz29Ov18/f7+tS/SqGBObmXSZBqMIZoQZ2CXKmQbryqkZJ7YY14boRtbP///8fHx5eXl5OTk4mJiYODg3Z2dnBwcGlpaWBgYP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADYALAAAAAANABAAAAZyQJtwSCyOQiRRKBVamVpCgkBAQqkCJ4DJJRwUSp2SpwQqsWbdR2ft4YAy5+5i3Wm/47YBo3PpW+5oeQl0dnCBAxB8fRcWLHgDDYRuhl0Hin6OhwiSgF0KfBaFjw5rHxobExQVMEMGERIYNTQyMS9Ft0RBADs=";
$img['rar'] = &$img['zip'];
$img['tar'] = &$img['zip'];
$img['html'] = &$img['htm'];
$img['php'] = &$img['htm'];
$img['asp'] = &$img['htm'];
$img['jpg'] = &$img['img'];
$img['gif'] = &$img['img'];
$img['png'] = &$img['img'];
$img['bmp'] = &$img['img'];
if(IsSet($img[$i]))
{
$d = &$img[$i];
}
else
{
$d = &$img['<x>'];
}
header('Content-type: image/gif');
header('Content-Disposition: attachment; filename="' . $i . '"');
echo base64_decode($d);
exit;
}
function getExt($filename)
{
$atemp = explode('.', $filename);
return strtolower($atemp[sizeof($atemp) - 1]);
}
function size($size)
{
$mult = 'kB';
$prec = 0;
if(round($size / 1024, 0))
{
$size /= 1024;
$mult = 'kB';
$prec = 3;
}
if(round($size / 1024, 0))
{
$size /= 1024;
$mult = 'mB';
$prec = 3;
}
return (round($size, $prec) . ' ' . $mult);
}
function fsize($sfile)
{
return filesize($sfile);
}
function dsize($sdir)
{
$size = 0;
$handle = opendir($sdir);
while(false !== ($read = readdir($handle)))
{
if($read <> '.' && $read <> '..')
{
if(is_file($sdir . $read))
{
$size += fsize($sdir . $read);
}
elseif(is_dir($sdir . $read))
{
$size += dsize($sdir . $read . '/');
}
}
}
return $size;
}
if(IsSet($_GET['dir']) && $_GET['dir'] <> '' && is_dir($_GET['dir']))
{
if($_GET['dir'] == './')
{
$dir = $_GET['dir'];
}
elseif(eregi('\.\./', $_GET['dir']))
{
$dir = './';
}
else
{
if(substr($_GET['dir'], -1) == '/')
{
$dir = $_GET['dir'];
}
else
{
$dir = $_GET['dir'] . '/';
}
}
} else {
$dir = './';
}
if($dir == './')
{
$cur_dir = 'Root';
}
else
{
$ex = explode('/', $dir);
array_pop($ex);
$cur_dir = ucwords(array_pop($ex));
}
$handle = opendir($dir);
while(false !== ($read = readdir($handle)))
{
if($read <> '.' && $read <> '..')
{
$show[] = $read;
}
}
?>
<title>Directory Indexer</title>
<style>
body { margin: 0px; }
body, td, th { font-family: Arial; font-size: 12px; }
a { color: #000000; text-decoration: underline; }
a:hover { color: #666666; text-decoration: none; }
.dir_container { border-left: 1px solid #000000; border-right: 1px solid #000000; width: 760px; }
.dir_container h1 { margin: 10px; }
.dir_container th { background-color: #000000; color: #FFFFFF; text-align: left; }
.row1 { background-color: #FFFFFF; }
.row2 { background-color: #DDDDDD; }
.error { background-color: #F2DDDD; border: 1px solid #992A2A; border-top: 0px; font-family: Verdana; margin: 5px; padding: 0px; }
.error h4 { background-color: #E3C0C0; border: 1px solid #992A2A; border-left: 0px; border-right: 0px; font-family: Verdana; color: #992A2A; font-size: 12px; font-weight: bold; margin: 0px; padding: 5px; }
.error p { background-color: transparent; border: 0px; font-family: Verdana; color: #992A2A; font-size: 12px; margin: 0px; padding: 8px; }
</style>
</head>
<body>
<div align="center">
<table style="width: 727px; height: 211px;" class="dir_container" border="0" cellpadding="5" cellspacing="0">
<tbody>
<tr>
<td colspan="5">
<h1><?php echo $cur_dir; ?></h1>
<?php if($dir <> './')
{
$ex = substr($dir, 2, -1);
$ex = explode('/', $ex);
array_pop($ex);
$dirs = '<a href="index.php?dir=./">Root</a> / ';
foreach($ex as $nr => $tdir)
{
$link = './';
for($i = 0; $i < $nr; $i++)
{
$link .= $ex[$i] . '/';
}
$dirs .= '<a href="index.php?dir=' . $link . $tdir . '">' . $tdir . '</a> / ';
}
echo $dirs;
}
?>
</td>
</tr>
<tr>
<th width="1%"></th>
<th>Naam:</th>
<th width="15%">Grootte:</th>
<th width="20%">Type:</th>
<th width="30%">Gewijzigd op:</th>
</tr>
<?php if(IsSet($show))
{
$i = 0;
foreach($show as $row)
{
$tr_class = ($i % 2 ? 'row1' : 'row2');
?>
<tr class="<?php echo $tr_class; ?>">
<td><img src="index.php?i=<?php echo (is_dir($dir . $row) ? 'dir' : getExt($row)); ?>" alt="<?php echo $row; ?>"></td>
<td><a href="<?php echo (is_dir($dir . $row) ? 'index.php?dir=' . $dir . $row : $dir . $row); ?>"><?php echo $row; ?></a></td>
<td align="right"><?php echo size(is_dir($dir . $row) ? dsize($dir . $row . '/') : fsize($dir . $row)); ?></td>
<td><?php echo (is_dir($dir . $row) ? 'Bestandsmap' : getExt($row) . ' bestand'); ?></td>
<td><?php echo date('F d Y H:i:s', filectime($dir . $row)); ?></td>
</tr>
<?php $i++;
}
}
else
{
?>
<tr>
<td colspan="5">
<div class="error">
<h4>Directory is leeg</h4>
<p>Er staan (nog) geen mappen en/of bestanden in deze directory.</p>
</div>
</td>
</tr>
<?php }
?>
</tbody>
</table>
</div>
</body>
</html>
{
$img [ 'img' ] = "R0lGODlhEAAQAPcAAP//////AP8A//8AAAD//wD/AAAA/wAAAPuBhP0RI7Crrr24vL25vn+CmJ6syZ6rxbfF4cbO3srO1oOk4WF4oo6fvpyuzqCvyqKxzKGwy6i30qa10KKxy6Oxy6Kwyb3M57G/2JyovqCswsTR6dDd9crW7NPe8tXg89Hb7uLs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kCJ4DJJRwUSp2SpwQqsWbdR2ft4YAy5+5i3Wm/47YBo3PpW+5oeQl0dnCBAxB8fRcWLHgDDYRuhl0Hin6OhwiSgF0KfBaFjw5rHxobExQVMEMGERIYNTQyMS9Ft0RBADs=" ;
$img [ 'rar' ] = & $img [ 'zip' ] ;
$img [ 'tar' ] = & $img [ 'zip' ] ;
$img [ 'html' ] = & $img [ 'htm' ] ;
$img [ 'php' ] = & $img [ 'htm' ] ;
$img [ 'asp' ] = & $img [ 'htm' ] ;
$img [ 'jpg' ] = & $img [ 'img' ] ;
$img [ 'gif' ] = & $img [ 'img' ] ;
$img [ 'png' ] = & $img [ 'img' ] ;
$img [ 'bmp' ] = & $img [ 'img' ] ;
{
$d = & $img [ $i ] ;
}
else
{
$d = & $img [ '<x>' ] ;
}
header ( 'Content-type: image/gif' ) ; header ( 'Content-Disposition: attachment; filename="' . $i . '"' ) ;
}
function getExt( $filename )
{
}
function size( $size )
{
$mult = 'kB' ;
$prec = 0 ;
if ( round ( $size / 1024 , 0 ) ) {
$size /= 1024 ;
$mult = 'kB' ;
$prec = 3 ;
}
if ( round ( $size / 1024 , 0 ) ) {
$size /= 1024 ;
$mult = 'mB' ;
$prec = 3 ;
}
return ( round ( $size , $prec ) . ' ' . $mult ) ; }
function fsize( $sfile )
{
}
function dsize( $sdir )
{
$size = 0 ;
while ( false !== ( $read = readdir ( $handle ) ) ) {
if ( $read <> '.' && $read <> '..' )
{
{
$size += fsize( $sdir . $read ) ;
}
{
$size += dsize( $sdir . $read . '/' ) ;
}
}
}
return $size ;
}
if ( IsSet ( $_GET [ 'dir' ] ) && $_GET [ 'dir' ] <> '' && is_dir ( $_GET [ 'dir' ] ) ) {
if ( $_GET [ 'dir' ] == './' )
{
$dir = $_GET [ 'dir' ] ;
}
elseif ( eregi ( '\.\./' , $_GET [ 'dir' ] ) ) {
$dir = './' ;
}
else
{
if ( substr ( $_GET [ 'dir' ] , - 1 ) == '/' ) {
$dir = $_GET [ 'dir' ] ;
}
else
{
$dir = $_GET [ 'dir' ] . '/' ;
}
}
} else {
$dir = './' ;
}
if ( $dir == './' )
{
$cur_dir = 'Root' ;
}
else
{
}
while ( false !== ( $read = readdir ( $handle ) ) ) {
if ( $read <> '.' && $read <> '..' )
{
$show [ ] = $read ;
}
}
?>
<title>Directory Indexer</title>
<style>
body { margin: 0px; }
body, td, th { font-family: Arial; font-size: 12px; }
a { color: #000000; text-decoration: underline; }
a:hover { color: #666666; text-decoration: none; }
.dir_container { border-left: 1px solid #000000; border-right: 1px solid #000000; width: 760px; }
.dir_container h1 { margin: 10px; }
.dir_container th { background-color: #000000; color: #FFFFFF; text-align: left; }
.row1 { background-color: #FFFFFF; }
.row2 { background-color: #DDDDDD; }
.error { background-color: #F2DDDD; border: 1px solid #992A2A; border-top: 0px; font-family: Verdana; margin: 5px; padding: 0px; }
.error h4 { background-color: #E3C0C0; border: 1px solid #992A2A; border-left: 0px; border-right: 0px; font-family: Verdana; color: #992A2A; font-size: 12px; font-weight: bold; margin: 0px; padding: 5px; }
.error p { background-color: transparent; border: 0px; font-family: Verdana; color: #992A2A; font-size: 12px; margin: 0px; padding: 8px; }
</style>
</head>
<body>
<div align="center">
<table style="width: 727px; height: 211px;" class="dir_container" border="0" cellpadding="5" cellspacing="0">
<tbody>
<tr>
<td colspan="5">
<h1>
<?php echo $cur_dir ; ?> </h1>
<?php if ( $dir <> './' )
{
$dirs = '<a href="index.php?dir=./">Root</a> / ' ;
foreach ( $ex as $nr => $tdir )
{
$link = './' ;
for ( $i = 0 ; $i < $nr ; $i ++ )
{
$link .= $ex [ $i ] . '/' ;
}
$dirs .= '<a href="index.php?dir=' . $link . $tdir . '">' . $tdir . '</a> / ' ;
}
}
?>
</td>
</tr>
<tr>
<th width="1%"></th>
<th>Naam:</th>
<th width="15%">Grootte:</th>
<th width="20%">Type:</th>
<th width="30%">Gewijzigd op:</th>
</tr>
{
$i = 0 ;
foreach ( $show as $row )
{
$tr_class = ( $i % 2 ? 'row1' : 'row2' ) ;
?>
<tr class="
<?php echo $tr_class ; ?> ">
<td><img src="index.php?i=
<?php echo ( is_dir ( $dir . $row ) ?
'dir' : getExt
( $row ) ) ; ?> " alt="
<?php echo $row ; ?> "></td>
<td><a href="
<?php echo ( is_dir ( $dir . $row ) ?
'index.php?dir=' . $dir . $row : $dir . $row ) ; ?> ">
<?php echo $row ; ?> </a></td>
<td align="right">
<?php echo size
( is_dir ( $dir . $row ) ? dsize
( $dir . $row . '/' ) : fsize
( $dir . $row ) ) ; ?> </td>
<td>
<?php echo ( is_dir ( $dir . $row ) ?
'Bestandsmap' : getExt
( $row ) . ' bestand' ) ; ?> </td>
</tr>
<?php $i ++;
}
}
else
{
?>
<tr>
<td colspan="5">
<div class="error">
<h4>Directory is leeg</h4>
<p>Er staan (nog) geen mappen en/of bestanden in deze directory.</p>
</div>
</td>
</tr>
<?php }
?>
</tbody>
</table>
</div>
</body>
</html>
als je door klikt zie je ook dat wanneer er teveel bestanden staan de layout wodt uitgerokken kun je hier op een of andere manieren scrolbars plaatsen
Gesponsorde links
Dit onderwerp is gesloten .