Code: Alles auswählen
//quelltext
<html>
<head>
<title>
<?php
$topic = $_GET['topic'];
$title = '_wiki :: My-Script.at';
$title = $_GET['topic'] . $title;
if ($topic == 'new'){
$title = 'neues Thema' . $title;
}
if ($topic == 'new2'){
$title = 'spechern des themas' . $title;
}
if ($topic == ''){
$title = 'home' . $title;
}
echo $title;
?>:</title>
</head>
<body>
<!---copyright My-Script.at copy und download erlaubt wenn dies ohne veränderung geschhieht//-->
<?php
if (($_GET['topic'] == '')){
echo "<h1>wiki_index</h1>";
//index...
$ordnername = "*.txt";
foreach (glob($ordnername) as $filename) {
$array_file = explode(".",$filename);
echo "<b><a href=\"./index.php?topic=" . $array_file[0] . "\">" . $array_file[0] . "</a></b><br>\n";
}
echo "\n<br><p><a href=\"./index.php?topic=new&name=topicname hier&text=TopicText hier\">schreib ein neues thema</a>";
}else{
if ($_GET['topic'] == 'new'){
$var1 = rand(0,9);
$var2 = rand(0,9);
$var3 = rand (0,9);
$var4 = rand (0,9);
$var5 = rand (0,9);
$var6 = rand (0,9);
$var7 = rand (0,9);
echo "<h1>New Topic!<br>\n</h1>";
if (($_GET["name"]<> "topicname hier")){
echo "<h2>\n Thema schon vorhanden</h2>";
}
echo "<form action=\"./index.php?topic=new2\" method=\"post\">";
echo "<h2>Topic:</h2>";
echo "<input type=\"text\" name=\"topic\" size=50 maxlength=120 value=\"" . $_GET["name"] . "\">";
echo "<h2>Text:</h2>";
$txt=str_replace("<br>","\n",$_GET["text"]);
echo "<textarea cols=\"40\" rows=\"10\" name=\"text\">" . $txt . "</textarea>";
echo "<h2>code:..</h2> <input type=\"text\" name=\"code\" size=50 maxlength=120 value=\"\"><img src=\"http://clemo.kilu.de/bild.php?num=" . $var1 . $var2 . $var3 . $var4 . $var5 . $var6 . $var7 . "\">";
echo "<input type=\"hidden\" name=\"codeR\" size=50 maxlength=120 value=\"" . $var1 . $var2 . $var3 . $var4 . $var5 . $var6 . $var7 ."\">";
echo "<input type=\"hidden\" value=\"1\" name=\"s\">";
echo "<input type=\"submit\" value=\"Nachricht versenden\" name=\"submit\">";
echo "</form>";
echo "<br>info:<br>";
echo "nur zeichen von A - Z und zahlen keinen Punkt \".\" oder sonderzeichen!!!(gilt für text)";
echo "<br>";
}else{
if (($_GET['topic'] == 'new2')){
$file = $_POST['topic'] . ".txt";
if(is_file($file)){
echo "dieses Thema existiert schon!!<br><a href=\"./index.php?topic=new&text=" . $_POST['text'] . "&name=" . $_POST['topic'] . "\">Back</a>";
}else{
if ($_POST['codeR'] == $_POST['code']){
$datei = fopen("./" . $_POST["topic"] . ".txt","w");
rewind($datei);
fwrite($datei, (nl2br($_POST["text"])));
fclose($datei);
echo "<a href=\"./index.php\"><h3>Übersicht</h3></a>";
echo "<meta http-equiv=\"refresh\" content=\"3; URL=./index.php\">";
}else{
echo "CODE IST FALSCH.....<br><a href=\"./index.php?topic=new&text=" . $_POST['text'] . "&name=" . $_POST['topic'] . "\">Back</a>";
//echo $_POST['codeR'];
//echo $_POST['code'];
}
}
}else{
//topic
echo "<a href=\"./index.php\">back</a><br>\n";
if(is_file("./" . $_GET["topic"] . ".txt")){
echo "<h1>" . $_GET["topic"] . "_wiki :: My-Script.at</h1><br>";
echo '<code>';
echo file_get_contents("./" . $_GET["topic"] . ".txt");
echo '</code>';
}else{
echo "file nicht gefunden\n<br>";
echo "<meta http-equiv=\"refresh\" content=\"2; URL=./index.php\">";
}
}
}
}
?><br><p>
<form action="./such.php" method="GET">
<input type="text" name="topic" size=50 maxlength=120 value="Suchbegriff">
<input type="submit" value="Suchen" name="submit">
</form><br><br><p>
<br><p>
<br>
powerd by <a href="http://My-Script.at"><img src="http://My-Script.at/powerd.png"></a>
<br>
<hr style="clear: both; width: 100%; color: rgb(192, 0, 0); background-color: rgb(192, 0, 0); height: 3px; margin-top: 0.4em;">
<br>
<script type="text/javascript"><!--
google_ad_client = "pub-5534776264723134";
/* 728x90, Erstellt 15.09.08 */
google_ad_slot = "9603633622";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</body></html>
Das mit den txt datein ist einfach aufgebaut
wird ein topic über z.b. Banannen geschrieben und der autor nennt ihm bannanen so wird eine banannen.txt angelegt
in diese wird dann der text gespeichert!
du meinst allso das suchscript soll einfach bei allen *.txt datein den inhalt lesen und dann alle gefundenen txt datein verlinken?
dauert das nicht zu lange?!? da ja immer ALLES gesucht werden muss!?!
und was würde es da für befehle geben?