Problem? Nein, nur eine Herausforderung!

alexanderneipp

Mitglied
Hi Leutz,

hab folgendes Script um in der Navigation eine Datei auszuählen, die dann in die Textarea geladen wird und dort editiert werden kann und schließlich wieder abgespeichert wird.
So im Groben und Ganzen denke ich stimmt das Script nur das Problem: Es passiert nix! Ich ruf das Teil auf uns egal was ich mach die Textarea bleibt leer.

Kann mir vielleicht jemand unter die Arme greifen?

Also hier das SCRIPT:
PHP:
    <?PHP
function auslesen() 
{
$dateiname = "../data/".$content ;
$fp = fopen ( $dateiname, "r") or die( "Konnte $dateiname nicht öffnen");
$text = fread( $fp, 4096 );
return $text;
fclose( $fp );
}

function update( $eintrag )
{
$dateiname = "../data/".$content ;
$fp = fopen( $dateiname, "w") or die(" Konnte $dateiname nicht öffnen");
fwrite( $fp, $eintrag );
fclose( $fp );
}
$ausgabe = auslesen();
if( isset( $aktion ) && $aktion=="update" )
{
update( $form );
header("Location: done.php");
exit;
}
else 
{
$form = $ausgabe;
}
?>
<html>

<head>
<link rel="stylesheet" type="text/css" href="../shared/global.css">
<title>:: admin tool ::</title>
</head>

<table border="0" cellspacing="1" width="100%" height="587">
  <tr>
    <td width="12%" align="left" height="584" valign="top">
    
    
    
    	<table border="0" cellspacing="0" width="104%" height="100" cellpadding="0">
          <tr>
            <td width="4%" height="75" rowspan="5">&nbsp;</td>
            <td width="87%" height="1" valign="bottom"><b>
            <img border="0" src="images/arrow_downright_dark.gif" width="9" height="9"> :: navigation</b></td>
            <td width="14%" height="75" rowspan="5">&nbsp;</td>
          </tr>
          <tr>
            <td width="87%" height="54" valign="top">
           		&nbsp;&nbsp; <A HREF="admin.php?content=me.txt">me</A><br>
			&nbsp;&nbsp; <A HREF="admin.php?content=equipment.txt">equipment</A><br>
			&nbsp;&nbsp; <A HREF="admin.php?content=pictures.txt">pictures</A><br>
			&nbsp;&nbsp; <A HREF="admin.php?content=portfolio.txt">portfolio</A><br>
			&nbsp;&nbsp; <A HREF="admin.php?content=links.txt">links</A><br>
			&nbsp;&nbsp; <A HREF="admin.php?content=emotions.txt" class="protected" alt="protected">e-motions</A></font><br>
			&nbsp;&nbsp; <A HREF="admin.php?content=shout.txt">shout-place</A></td>
          </tr>
          <tr>
            <td width="87%" height="15" valign="top"></td>
          </tr>
          <tr>
            <td width="87%" height="1" valign="top"><b>
            
            <img border="0" src="images/arrow_downright_dark.gif" width="9" height="9"> :: contact</b></td>
          </tr>
          <tr>
            <td width="87%" height="71" valign="top">
            	&nbsp;&nbsp; <A HREF="admin.php?content=form.txt">contact - form</A><br>
		&nbsp;&nbsp; <A HREF="admin.php?content=e-mail.txt">e-mail + icq</A><br>
		&nbsp;&nbsp; <A HREF="admin.php?content=adress.txt">adress</A></font></td>
          </tr>
        </table>
    
    
    
    
    </td>
    <td width="88%" height="584" valign="top">
    
    
    
    


<form action="<?PHP print $PHP_SELF; ?>">
<input type="hidden" name="aktion" value="update">
<textarea name="form" rows=20 cols=80 wrap="virtual">
<?PHP print stripslashes( $form ); ?>
</textarea>
<input type="submit" value="aktualisieren">
</form>


    
    
    
    
    
    
    
    
    </td>
  </tr>
</table>

</body>

</html>


Danke!
 
PHP:
function auslesen() 
{
$dateiname = "../data/".$content ;
$fp = fopen ( $dateiname, "r") or die( "Konnte $dateiname nicht öffnen");
$text = fread( $fp, 4096 );
return $text;
fclose( $fp );
}
$content 'global'isieren oder als Argument übergeben ?

Grüße, Morph
 
Sorry

Tut mir leid Morph, aber ich bin echt eine totale Flasche was PHO angeht. Könntest du mir weiterhelfen?! Versteh nämlich nicht so ganz was du von mir willst.... :rolleyes:
 
Zurück