Es geht darum, ich habe meinem Vater eine Homepage eingerichtet. Beim Test auf funpic lief alles zu 100%.
Als ich das dann auf seinem Telecom-Server installieren wollte kam es zu einigen schwirigkeiten. Das eine Problem ist das Telecom den Upload per PHP-Formular verbietet. Auf anfrage bei dem Rosa Elefanten sagten die mir ich müsste move-upload oder sowas nehmen. Da ich aber soviel ahnung nicht habe wollte ich fragen ob sich jemand des Codes annimmt und das umschreiben kann. :
Als ich das dann auf seinem Telecom-Server installieren wollte kam es zu einigen schwirigkeiten. Das eine Problem ist das Telecom den Upload per PHP-Formular verbietet. Auf anfrage bei dem Rosa Elefanten sagten die mir ich müsste move-upload oder sowas nehmen. Da ich aber soviel ahnung nicht habe wollte ich fragen ob sich jemand des Codes annimmt und das umschreiben kann. :
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta http-equiv="expires" content="0">
<title>Marktplatz</title>
<link rel="stylesheet" type="text/css" href="admin.css">
<script src="eingabe.js" type="text/javascript"></script>
</head>
<body marginwidth="0" marginheight="0" style="margin-left:8px;margin-right:8px;margin-top:16px;margin-bottom:8px">
<div align="center">
<h3>Marktplatz - neues Iserat eingeben</h3>
<form action="eingabe.php" enctype="multipart/form-data" method="POST">
<?php
include('../werte.php'); if(empty($AutoNrLaenge)) $AutoNrLaenge=5;
if($Grp=$_POST['grp'].$_GET['grp']){//Segment gewaehlt
$Dir='../'.$Grp.'/'; $aD=file($Dir.'daten.txt'); $H1=rtrim(array_shift($aD)); $H2=rtrim(array_shift($aD)); $H3=rtrim(array_shift($aD));
$aF=explode(';',$H1); $aT=explode(';',strtolower($H2)); $aS=explode(';',$H3); $Fc=count($aF);
if($_SERVER['REQUEST_METHOD']!='POST'){//GET
echo '<p><b>Tragen Sie ein neues Inserat im Segment <i>'.$Grp.'</i> ein!</b></p>';
if($i=strpos(strtolower($H2),'i')/2) $$aF[$i]=str_repeat('X',$AutoNrLaenge);
}else{//POST
if(is_array($aT)&&$aT[0]=='d'&&$Fc>1){
for($i=1;$i<$Fc;$i++){
$t=$aT[$i]; $F=$aF[$i]; $In=trim($_POST[$F]);
if($t=='t'||$t=='m'||$t=='p'||$t=='z'||$t=='a'||$t=='l'){//Text
$In=str_replace("\\\\","\\",str_replace('\"','"',str_replace("\'","'",$In)));
if($t=='l') $In=str_replace('http://','',str_replace('mailto:','',$In));
elseif($t=='p')if(!empty($In)){
if($TausendTrenner) $In=str_replace($TausendTrenner,'',$In);
$In=str_replace('.',',',sprintf('%.2f',str_replace(',','.',$In)));
}
$$F=$In; if(empty($In)&&$aS[$i]>='p') $Nd.=', '.$F;
$L.=';'.str_replace(';',chr(127),str_replace("\n",'|',str_replace("\r",'',$In)));
}elseif($t=='i'){//AutoIncrement
$aE=file('../'.$Grp.'/eingabe.txt');
$In=sprintf('%0'.$AutoNrLaenge.'d',$aE[$i]); $aE[$i]=sprintf('%0'.$AutoNrLaenge.'d',1+$In); $L.=';'.$In; $$F=$In;
}elseif($t=='j'){//JaNein
if(empty($In)){$L.=';N'; $$F='';} else{$L.=';J'; $$F=' checked';}
}elseif($t=='b'){//Bild
$ImNa=str_replace(' ','_',basename($_FILES[$F]['name'])); $ImEx=strtolower(strrchr($ImNa,'.'));
if($ImEx=='.jpg'||$ImEx=='.gif'||$ImEx=='.jpeg'||$ImEx=='.png'){
if($_FILES[$F]['size']<=(1024*$BildMaxKByte)){
if($ImEx=='.jpg'||$ImEx=='.jpeg') $Src=ImageCreateFromJPEG($_FILES[$F]['tmp_name']);
elseif($ImEx=='.gif')$Src=ImageCreateFromGIF($_FILES[$F]['tmp_name']);
elseif($ImEx=='.png')$Src=ImageCreateFromPNG($_FILES[$F]['tmp_name']);
if(!empty($Src)){
$ImNa=substr($ImNa,0,strpos(strtolower($ImNa),$ImEx)).'.jpg';
$Sx=ImageSX($Src); $Sy=ImageSY($Src);
$Dw=min($VorschauBreite,$Sx); if($Sx>$VorschauBreite) $Dh=round($VorschauBreite/$Sx*$Sy); else $Dh=$Sy;
if($Dh>$VorschauHoehe){$Dw=round($VorschauHoehe/$Dh*$Dw);$Dh=$VorschauHoehe;}
$Dest=ImageCreateTrueColor($Dw,$Dh); ImageFill($Dest,0,0,ImageColorAllocate($Dest,255,255,255));
imagecopyresampled($Dest,$Src,0,0,0,0,$Dw,$Dh,$Sx,$Sy); ImageJPEG($Dest,$Dir.'klein/'.$ImNa); imagedestroy($Dest);
if($Sx<=$BildBreite){$Dw=$Sx;$Dh=$Sy;}else{$Dw=$BildBreite;$Dh=round($BildBreite/$Sx*$Sy);}
if($Dh>$BildHoehe){$Dh=$BildHoehe;$Dw=round($BildHoehe/$Sy*$Sx);}
$Dest=ImageCreateTrueColor($Dw,$Dh); ImageFill($Dest,0,0,ImageColorAllocate($Dest,255,255,255));
imagecopyresampled($Dest,$Src,0,0,0,0,$Dw,$Dh,$Sx,$Sy); ImageJPEG($Dest,$Dir.'gross/'.$ImNa);
imagedestroy($Dest); imagedestroy($Src); unset($Dest); unset($Src);
$L.=';'.$ImNa;
echo '<input type="hidden" name="Img'.$i.'Na" value="'.$ImNa.'">'."\n"; $bImg=true;
}else $Msg='<p class="err">Das Bild <i>'.$F.'</i> konnte nicht verarbeitet werden!</p>';
}else $Msg='<p class="err">Bilder größer als <i>'.$BildMaxKByte.' KByte</i> sind nicht erlaubt!</p>';
}elseif(substr($ImEx,0,1)=='.'){
$Msg='<p class="err">Bilder mit der Endung <i>'.$ImEx.'</i> sind nicht erlaubt!</p>';
}elseif($ImNa=$_POST['Img'.$i.'Na']){
echo '<input type="hidden" name="Img'.$i.'Na" value="'.$ImNa.'">'."\n"; $L.=';'.$ImNa; $v=$ImNa; $bImg=true;
}else $L.=';';
}elseif($t=='o'){//Objekt
if($ONa=str_replace(' ','_',basename($_FILES[$F]['name']))){
if($_FILES[$F]['size']<=(1024*$ObjektMaxKByte)){
if(copy($_FILES[$F]['tmp_name'],$Dir.'objekte/'.$ONa)){
$L.=';'.$ONa; echo '<input type="hidden" name="Obj'.$i.'Na" value="'.$ONa.'">'."\n"; $bObj=true;
}else $Msg='<p class="err">Das Objekt <i>'.$F.'</i> konnte nicht verarbeitet werden!</p>';
}else $Msg='<p class="err">Objekte größer als <i>'.$ObjektMaxKByte.' KByte</i> sind nicht erlaubt!</p>';
}elseif($ONa=$_POST['Obj'.$i.'Na']){
echo '<input type="hidden" name="Obj'.$i.'Na" value="'.$ONa.'">'."\n"; $L.=';'.$ONa; $v=$ONa; $bObj=true;
}else $L.=';';
}elseif($t=='c') $L.=';';//Passwort
}
if(!$Nd=substr($Nd,2)){//Eintragen
if(empty($Msg)){
for($i=1;$i<$Fc;$i++) if($aS[$i]=='s') $aZ[]=$i; if(is_array($aZ)) $Sc=count($aZ); else $Sc=0;
$aD[]=date('y-m-d',time()+86400*$AnzeigeTage).$L; if($SortiereAbsteigend==1) rsort($aD); else sort($aD); $Dc=count($aD); $F='';
$OfDate=date('y-m-d',time()-86400*$OfflineTage);
for($i=0;$i<$Dc;$i++) if($L=rtrim($aD[$i])) if(substr($L,0,8)>=$OfDate){
$F.=$L."\n";
if($Sc>0){//Sortierung vorbereiten
$aL=explode(';',$L);
for($j=0;$j<$Sc;$j++){
$s=strtolower(strip_tags($aL[$aZ[$j]])); if($aT[$aZ[$j]]=='p'||$aT[$aZ[$j]]=='z') $s=sprintf('%09.2f',str_replace(',','.',$s));
$s.="\n".sprintf('%04d',$i); $aSL[$j][$i]=$s; $aNL[$j][$s]=$i;
}
}
}
if($f=fopen($Dir.'daten.txt','w')){//Speichern
fwrite($f,$H1."\n".$H2."\n".$H3."\n".$F); fclose($f);
echo '<p class="ok">Das Inserat wurde gespeichert!</p>'; $C1Sm='<!--'; $C2Sm='-->';
for($j=0;$j<$Sc;$j++){//Sortierungen
sort($aSL[$j]); $F='';
while(list($key,$val)=each($aSL[$j])) $F.=rtrim($aD[$aNL[$j][$val]])."\n";
if($f=fopen($Dir.'daten'.$aZ[$j].'.txt','w')){fwrite($f,$H1."\n".$H2."\n".$H3."\n".$F); fclose($f);}
else $Msg.='<p class="err">Die Datei <i>'.$Dir.'daten'.$aZ[$j].'.txt</i> konnte nicht gespeichert werden.</p>';
}
if(strpos(strtolower($H2),'i')>0){
if($f=fopen('../'.$Grp.'/eingabe.txt','w')){
for($i=0;$i<$Fc;$i++) fwrite($f,rtrim($aE[$i])."\n"); fclose($f);
}else echo '<p class="err">Die Datei <i>../'.$Grp.'/eingabe.txt</i> konnte nicht gespeichert werden.</p>';
}
}else echo '<p class="err">Das Inserat konnte nicht eingetragen werden!</p>';
}//Bildfehler
}else echo '<p class="err">Die Eintragungen bei '.$Nd.' sind unzureichend!</p>';
echo $Msg;
}else echo '<p class="err">Die Struktur der Datei <i>'.$Dir.'daten.txt</i> ist ungültig!</p>';
}
?>
<table class="da" border="0" cellpadding="3" cellspacing="1">
<?php
if(is_array($aT)&&$aT[0]=='d'&&$Fc>1) for($i=1;$i<$Fc;$i++){
$t=$aT[$i]; $F=$aF[$i];
echo ' <tr class="da">'."\n".' <td valign="top"><div><img src="void.gif" width="1" height="4" border="0" alt=""></div>'.$F."</td>\n".' <td width="450">';
if($t=='t'||$t=='l') echo '<input type="text" name="'.$F.'" value="'.$$F.'" style="width:450px;">';
elseif($t=='m'){
?>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="24"><input type="button" value="b" style="font-weight:bold;width:22px" onClick="fmt('<?php echo $F;?>',0)" onMouseOver="hlp('b',<?php echo $i;?>)" onMouseOut="nohlp(<?php echo $i;?>)" /></td>
<td width="24"><input type="button" value="i" style="font-style:italic;width:22px" onClick="fmt('<?php echo $F;?>',2)" onMouseOver="hlp('i',<?php echo $i;?>)" onMouseOut="nohlp(<?php echo $i;?>)" /></td>
<td width="24"><input type="button" value="u" style="text-decoration:underline;width:22px" onClick="fmt('<?php echo $F;?>',4)" onMouseOver="hlp('u',<?php echo $i;?>)" onMouseOut="nohlp(<?php echo $i;?>)" /></td>
<td width="24"><input type="button" value="c" style="width:22px" onClick="fmt('<?php echo $F;?>',6)" onMouseOver="hlp('c',<?php echo $i;?>)" onMouseOut="nohlp(<?php echo $i;?>)" /></td>
<td width="24"><input type="button" value="r" style="width:22px" onClick="fmt('<?php echo $F;?>',8)" onMouseOver="hlp('r',<?php echo $i;?>)" onMouseOut="nohlp(<?php echo $i;?>)" /></td>
<td width="44"><input type="button" value="Aufz." style="width:42px" onClick="fmt('<?php echo $F;?>',10)" onMouseOver="hlp('l',<?php echo $i;?>)" onMouseOut="nohlp(<?php echo $i;?>)" /></td>
<td width="44"><input type="button" value="Numr." style="width:42px" onClick="fmt('<?php echo $F;?>',12)" onMouseOver="hlp('n',<?php echo $i;?>)" onMouseOut="nohlp(<?php echo $i;?>)" /></td>
<td width="48" align="right"> Farbe:</td>
<td width="75">
<select name="fCol<?php echo $i;?>" style="width:75px;" onChange="fSty('<?php echo $F;?>','[color='+this.options[this.selectedIndex].value+']','[/color]');this.selectedIndex=0;" onMouseOver="hlp('o',<?php echo $i;?>)" onMouseOut="nohlp(<?php echo $i;?>)">
<option style="color:black;" value="black">Schwarz</option>
<option style="color:red;" value="red">Rot</option>
<option style="color:violet;" value="violet">Violett</option>
<option style="color:brown;" value="brown">Braun</option>
<option style="color:yellow;" value="yellow">Gelb</option>
<option style="color:green;" value="green">Grün</option>
<option style="color:lime;" value="lime">Limette</option>
<option style="color:olive;" value="olive">Oliv</option>
<option style="color:cyan;" value="cyan">Cyan</option>
<option style="color:blue;" value="blue">Blau</option>
<option style="color:navy;" value="navy">Navy</option>
<option style="color:gray;" value="gray">Grau</option>
<option style="color:silver;" value="silver">Silber</option>
<option style="color:white;background-color:#999999" value="white">Weiß</option>
</select>
</td>
<td width="48" align="right">Größe:</td>
<td width="70">
<select name="fSiz<?php echo $i;?>" style="width:70px;" onChange="fSty('<?php echo $F;?>','[size='+this.options[this.selectedIndex].value+']','[/size]');this.selectedIndex=0;" onMouseOver="hlp('s',<?php echo $i;?>)" onMouseOut="nohlp(<?php echo $i;?>)">
<option value="11">normal</option>
<option value="9">winzig</option>
<option value="10">klein</option>
<option value="11">normal</option>
<option value="13">groß</option>
<option value="16">sehr groß</option>
</select>
</td>
</tr>
</table>
<div><input type="text" name="HinT<?php echo $i;?>" class="hnt" style="width:450px;font-size:10px;border-style:none;" value="Tip: Erfassen Sie erst den kompletten Text und formatieren Sie ihn zum Schluß." /></div>
<?php
echo ' <textarea name="'.$F.'" rows="8" style="width:450px;">'.$$F.'</textarea>';}
elseif($t=='i') echo $$F.'<input type="hidden" name="'.$F.'" value="'.$$F.'">';
elseif($t=='p') echo '<input type="text" name="'.$F.'" value="'.$$F.'" style="width:80px;">'.$Waehrung;
elseif($t=='z') echo '<input type="text" name="'.$F.'" value="'.$$F.'" style="width:100px;">';
elseif($t=='a'){
if(!is_array($aE)) $aE=file('../'.$Grp.'/eingabe.txt');
$aB=explode(';',rtrim($aE[$i])); $Sl='<option value=""></option>'; $In=${$F};
for($k=0;$k<count($aB);$k++){
if($Vl=trim($aB[$k])){if($Vl==$In) $Op=' selected'; else $Op='';} else $Op='';
$Sl.='<option'.$Op.'>'.$Vl.'</option>';
}
echo '<select name="'.$F.'" style="width:450px;">'.$Sl.'</select>';
}elseif($t=='j') echo '<input type="checkbox" value="J" name="'.$F.'"'.${$F}.'>';
elseif($t=='b'||$t=='o') echo '<input type="file" name="'.$F.'" style="width:450px;">';
elseif($t=='c') echo 'nur für Besucher';
echo "</td>\n </tr>\n";
}else echo ' <tr class="da"><td class="err">Struktur der Datei <i>'.$Dir.'daten.txt</i> ungültig!</td></tr>'."\n";
?>
</table><div><img src="void.gif" width="1" height="12" border="0" alt=""></div>
<?php echo $C1Sm;?><input type="submit" value="Eintragen"><?php echo $C2Sm;?><input type="hidden" name="grp" value="<?php echo $Grp;?>">
<?php }else echo '<br><p><b>Bitte wählen Sie erst ein Marktsegment!</b></p>';?>
</form>
</div>
</body>
</html>