hi ihr php's
hab da ne frage, ich hab ein form in dem ich dateien uploaden möchte!
das problem ist, glaube ich das die variable
immer leer bleibt
kann mir da wer helfen? danke
hier mein code:
hab da ne frage, ich hab ein form in dem ich dateien uploaden möchte!
das problem ist, glaube ich das die variable
PHP-Code:
$file_name
kann mir da wer helfen? danke
hier mein code:
PHP-Code:
<?PHP
if(!empty($file_name))
{
$pfad = pathinfo($file_name);
if($file_size > "124000")
{
?>
<table width="400" cellspacing="0" cellpadding="0" border="0" class="table">
<tr>
<td bgcolor="<?php echo $bgtitel; ?>" class="rahmenlinksrechtsobenunten" width="100%"><img src="../images/spacer.gif" width="5"><span class="tabletitel">Avatar hinzufügen</span></td>
</tr>
</table>
<table width="400" cellspacing="0" cellpadding="0" border="0" class="table">
<tr>
<td class="rahmenlinksrechts"><img src="../images/spacer.gif" height="2"></td>
</tr>
<tr>
<td class="rahmenlinksrechts"><img src="../images/spacer.gif" width="5">Datei ist zu gross!</td>
</tr>
<tr>
<td class="rahmenlinksrechts"><img src="../images/spacer.gif" width="5"><a href="Javascript:history.back()">zurück</a></td>
</tr>
<tr>
<td class="rahmenlinksrechtsunten" ><img src="../images/spacer.gif" height="2"></td>
</tr>
</table>
<?php
}
elseif($pfad["extension"] == "gif")
{
$file_name = $nickname.".".$pfad["extension"];
if(file_exists($file_name))
{
rename($file_name,"nix");
}
if(@copy($file,"../tmp/$file_name"))
{
if(is_uploaded_file($file))
{
$bild = "../tmp/".$file_name;
$info = getimagesize($bild);
if ($info[0] > "110")
{
?>
<table width="400" cellspacing="0" cellpadding="0" border="0" class="table">
<tr>
<td bgcolor="<?php echo $bgtitel; ?>" class="rahmenlinksrechtsobenunten" width="100%"><img src="../images/spacer.gif" width="5"><span class="tabletitel">Avatar hinzufügen</span></td>
</tr>
</table>
<table width="400" cellspacing="0" cellpadding="0" border="0" class="table">
<tr>
<td class="rahmenlinksrechts"><img src="../images/spacer.gif" height="2"></td>
</tr>
<tr>
<td class="rahmenlinksrechts"><img src="../images/spacer.gif" width="5">Das Bild ist zu breit! (max. 100 px!)</td>
</tr>
<tr>
<td class="rahmenlinksrechts"><img src="../images/spacer.gif" width="5"><a href="Javascript:history.back()">zurück</a></td>
</tr>
<tr>
<td class="rahmenlinksrechtsunten" ><img src="../images/spacer.gif" height="2"></td>
</tr>
</table>
<?php
}
else
{
?>
<table width="400" cellspacing="0" cellpadding="0" border="0" class="table">
<tr>
<td bgcolor="<?php echo $bgtitel; ?>" class="rahmenlinksrechtsobenunten" width="100%"><img src="../images/spacer.gif" width="5"><span class="tabletitel">Avatar hinzufügen</span></td>
</tr>
</table>
<table width="400" cellspacing="0" cellpadding="0" border="0" class="table">
<tr>
<td class="rahmenlinksrechts"><img src="../images/spacer.gif" height="2"></td>
</tr>
<tr>
<td class="rahmenlinksrechts"><img src="../images/spacer.gif" width="5">Upload beendet</td>
</tr>
<tr>
<td class="rahmenlinksrechts"><img src="../images/spacer.gif" width="5">Bildbreite <?php echo $info[0]; ?></td>
</tr>
<tr>
<td class="rahmenlinksrechts"><img src="../images/spacer.gif" width="5">Bildhöhe <?php echo $info[1]; ?></td>
</tr>
<tr>
<td class="rahmenlinksrechts"><img src="../images/spacer.gif" width="5"><a href="forum.php?aktion=editprof">weiter</a></td>
</tr>
<tr>
<td class="rahmenlinksrechtsunten" ><img src="../images/spacer.gif" height="2"></td>
</tr>
</table>
<?php
}
}
}
else
{
?>
<table width="400" cellspacing="0" cellpadding="0" border="0" class="table">
<tr>
<td bgcolor="<?php echo $bgtitel; ?>" class="rahmenlinksrechtsobenunten" width="100%"><img src="../images/spacer.gif" width="5"><span class="tabletitel">Avatar hinzufügen</span></td>
</tr>
</table>
<table width="400" cellspacing="0" cellpadding="0" border="0" class="table">
<tr>
<td class="rahmenlinksrechts"><img src="../images/spacer.gif" height="2"></td>
</tr>
<tr>
<td class="rahmenlinksrechts"><img src="../images/spacer.gif" width="5">Es ist ein Fehler aufgetreten</td>
</tr>
<tr>
<td class="rahmenlinksrechts"><img src="../images/spacer.gif" width="5"><a href="Javascript:history.back()">zurück</a></td>
</tr>
<tr>
<td class="rahmenlinksrechtsunten" ><img src="../images/spacer.gif" height="2"></td>
</tr>
</table>
<?php
}
}
else
{
?>
<table width="400" cellspacing="0" cellpadding="0" border="0" class="table">
<tr>
<td bgcolor="<?php echo $bgtitel; ?>" class="rahmenlinksrechtsobenunten" width="100%"><img src="../images/spacer.gif" width="5"><span class="tabletitel">Avatar hinzufügen</span></td>
</tr>
</table>
<table width="400" cellspacing="0" cellpadding="0" border="0" class="table">
<tr>
<td class="rahmenlinksrechts"><img src="../images/spacer.gif" height="2"></td>
</tr>
<tr>
<td class="rahmenlinksrechts"><img src="../images/spacer.gif" width="5">Falscher Dateityp!</td>
</tr>
<tr>
<td class="rahmenlinksrechts"><img src="../images/spacer.gif" width="5"><a href="Javascript:history.back()">zurück</a></td>
</tr>
<tr>
<td class="rahmenlinksrechtsunten" ><img src="../images/spacer.gif" height="2"></td>
</tr>
</table>
<?php
}
}
else
{
?>
<form name="addavatar" enctype="multipart/form-data" method="post" action="forum.php?aktion=addavatar">
<table width="400" cellspacing="0" cellpadding="0" border="0" class="table">
<tr>
<td bgcolor="<?php echo $bgtitel; ?>" class="rahmenlinksrechtsobenunten" width="100%"><img src="../images/spacer.gif" width="5"><span class="tabletitel">Avatar hinzufügen</span></td>
</tr>
</table>
<table width="400" cellspacing="0" cellpadding="0" border="0" class="table">
<tr>
<td class="rahmenlinksrechts" colspan="2"><img src="../images/spacer.gif" height="2"></td>
</tr>
<tr>
<td class="rahmenlinks"><img src="../images/spacer.gif" width="5">Avatar:</td>
<td class="rahmenrechts"><img src="../images/spacer.gif" width="5"><input type="file" name="file" class="uploadinput"></td>
</tr>
<tr>
<td class="rahmenlinks"><img src="../images/spacer.gif" width="5"></td>
<td class="rahmenrechts"><img src="../images/spacer.gif" width="5"><input type="submit" name="Abschicken" value="Upload" class="button"></td>
</tr>
<tr>
<td class="rahmenlinksrechtsunten" colspan="2"><img src="../images/spacer.gif" height="2"></td>
</tr>
</table>
</form>
<?PHP
}
?>
Kommentar