Hier mal die Source:
[PHP]
<body>
<?php
error_reporting(E_ALL);
if (isset($_POST['script_name']))
{
$script_name = $_POST['script_name'];
if (isset($_POST['text']))
file_put_contents('http://meineadresse.com/'.$script_name.'.php');
?>
<form method="post" action="editor_pub.php" name="source_edit" id="formular">
<input type="hidden" name="script_name" value="<?php echo ($script_name); ?>">
<table>
<tr>
<td style="padding:2px"><strong><?php echo $script_name; ?>.php Inhalt:</strong></td>
</tr>
<tr>
<td style="padding:2px">
<textarea cols="140" rows="15" name="text"><?php echo file_get_contents('http://meineadresse.com/'.$script_name.'.php'); ?></textarea>
</td>
</tr>
<tr>
<td align="center" style="padding:2px">
<input name="submit" type="submit" id="speichern" value="Speichern" />
<input name="loeschen" type="reset" id="loeschen" value="Zurücksetzen" /><br />
<a href="editor_pub.php"><input type=submit name=sbm value=Back></a>
<input name="sbm" type="submit" value="Close" onClick="self.close()" />
</td>
</tr>
</table>
</form>
<?php
}
else
{
?>
<div class="line">
<p><strong>Script-Editor Public-Directory:</strong></p>
</div>
<form action="editor_pub.php" method="post">
<table>
<tr>
<td style="padding:2px"><p>Bitte Script auswählen:</p></td>
</tr>
<tr>
<td style="padding:2px"><strong>Script-Name:</strong></td>
<td style="padding:2px"><select id="auswahl" name="script_name">
<option value="option1">Option1</option>
<option value="option2">Option2<option></select>
</td>
</tr>
<tr>
<td>
<input name="Submit" type="submit" value="Enter" />
<input name="sbm" type="submit" value="Close" onClick="self.close()" />
</td>
</tr>
</table>
</form>
<?
}
?>
</body>
[/CODE]
Es ist im Grunde 1:1 dasselbe Script wie vorher, nur dass ich eben nicht aufs "Scripts" Verzeichnis, sondern gleich direkt auf die Dateien in meinem /pub/ Ordern zugreife.
--
The problem with America is stupidity.
I'm not saying there should be a capital punishment for stupidity, but why don't we just take the safety labels off of everything and let the problem solve itself?
----
Arguing with the moderators is like shaking your fist at God. There's nobody there; and if there is, he's not listening. And if he's listening, all you're doing is pissing him off.
Deins: file_put_contents('http://meineadresse.com/'.$script_name.'.php');
Meins: file_put_contents('scripts/'.$script_name.'/index_'.$script_name.'.txt', $_POST['text']);
Merkst was? Dann deine Fehlermeldung "file_put_contents() expects at least 2 parameters,..."
Du gibst nur einen Parameter an, nämlich in welche Datei er speichern soll. Es fehlt noch das ,$_POST['text'] also das, was er da hineinspeichern soll, gelle!![]()
Hier liegt der Fehler!
Du hast vielleicht wieder zu schnell Suchen und ersetzen gespielt, denn diese Funktion sieht aus wie die file_get_contents() später im Text.
file_put_contents() hier braucht zwei Werte! Zuerst den Pfad zur Datei in die du alles schreibst und danach den Inhalt, den du schreibst. Außerdem darf file_put_contents() keine Adresse im WWW sein sondern muss dem Dateipfad des Servers entsprechen.
Musst du halt anpassen^^
![]()
![]()
mitaki
![]()
![]()
![]()
![]()
![]()
Lucleonhart
![]()
![]()
![]()
![]()
![]()
<insert name>
![]()
![]()
![]()
A2k
--
The problem with America is stupidity.
I'm not saying there should be a capital punishment for stupidity, but why don't we just take the safety labels off of everything and let the problem solve itself?
----
Arguing with the moderators is like shaking your fist at God. There's nobody there; and if there is, he's not listening. And if he's listening, all you're doing is pissing him off.
Huch, da war ich aber langsam! Gar nicht bemerkt dass der Wolf schon vor mir was geschrieben hatte^^