Her er addfile:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 2</title>
</head>
<body>
<?php
//Kode til back: $_SERVER['HTTP_REFERER']
//Extra
//------------
//Nummer------------------------
$folder = opendir($whichSection . "C:\\wamp\\www\\Overskrift" . $who . "/");
$counter = 1;
while($file = readdir($folder)){
if($file != '.' && $file != '..'){
$counter++;
}
}
closedir($folder);
//------------------------------
//Reply nummer-----------
$folder2 = opendir($whichSection . "C:\\wamp\\www\\Overskrift" . $who . "/");
$counter2 = 1;
while($file = readdir($folder2)){
if($file != '.' && $file != '..'){
}
}
closedir($folder2);
$folder3 = opendir($whichSection . "C:\\wamp\\www\\Overskrift" . $who . "/");
$counter3 = 3;
while($file = readdir($folder3)){
if($file != '.' && $file != '..'){
}
}
closedir($folder3);
//----------------
//Laver en reply--------------------
if(isset($_POST['submit'])) //Er formen i addfile.htm blevet sendt?
{
$Rep = "Rep";
$file_directory6 = "C:\\wamp\\www\\Test/"; //Hvor skal filen ligge?
$file_name6 = $Rep.$counter;//Hvad filen skal hedde.
$file_ext6 = ".php"; //Hvilken slags fil den skal være.
$file6 = $file_directory6.$file_name6.$file_ext6; //Hele filnavnet.
$create_file6 = fopen($file6, "w+"); //Laver filen.
if(!$create_file6)
{
die("");
}
$chmod = chmod($file, 0755); //set the appropriate permissions.
//attempt to set the permissions
if(!$chmod)
{
echo "";
}
//attempt to write basic content to the file
if (fwrite($create_file6, "<?php
$name = $file_name7.$file_ext7;
include 'New.php'; ?>") === FALSE)
{
echo "Error writing to file: ($file6)\\n"; }
fclose($create_file6);
}else{ //Formen i Start.php er ikke blevet sendt!
}
//------------------------------
//Laver reply 2------------------------------------------------
if(isset($_POST['submit'])) //Er formen i addfile.htm blevet sendt?
{
function navn ($navn, $email) {
$str = 'Hej ' . $navn . '!';
mail($email, "Hilsen", $str);
return $str.'<br />';
}
$Rep2 = "Reply";
$file_directory7 = "C:\\wamp\\www\\Test/"; //Hvor skal filen ligge?
$file_name7 = $Rep2.$counter;//Hvad filen skal hedde.
$file_ext7 = ".php"; //Hvilken slags fil den skal være.
$file7 = $file_directory7.$file_name7.$file_ext7; //Hele filnavnet.
$create_file7 = fopen($file7, "w+"); //Laver filen.
if(!$create_file7)
{
die("");
}
$chmod = chmod($file, 0755); //set the appropriate permissions.
//attempt to set the permissions
if(!$chmod)
{
echo "";
}
//attempt to write basic content to the file
if (fwrite($create_file7, "<?php include 'Reply.php'; ?>") === FALSE)
{
echo "Error writing to file: ($file7)\\n"; }
fclose($create_file7);
}else{ //Formen i Start.php er ikke blevet sendt!
}
//-----------------------------
//Overskrift------------------------------------------------------------------------------------
if(isset($_POST['submit'])) //Er formen i addfile.htm blevet sendt?
{
$over = strip_tags($_POST['Over']); //Teksten i selve filen skal være der hvor ´text´står. (Efter POST)
$file_directory = "C:\\wamp\\www\\Overskrift/"; //Hvor skal filen ligge?
$file_name = $counter;//Hvad filen skal hedde.
$file_ext = ".txt"; //Hvilken slags fil den skal være.
$file = $file_directory.$file_name.$file_ext; //Hele filnavnet.
$create_file = fopen($file, "w+"); //Laver filen.
if(!$create_file)
{
die("");
}
$chmod = chmod($file, 0755); //set the appropriate permissions.
//attempt to set the permissions
if(!$chmod)
{
echo "";
}
//attempt to write basic content to the file
if (fwrite($create_file, "$over") === FALSE)
{
echo "Error writing to file: ($file)\\n"; }
fclose($create_file);
}else{ //Formen i Start.php er ikke blevet sendt!
}
//Overskrift slut-------------------------------------------------------------------------------
if(isset($_POST['submit'])) //Er formen i Start.htm blevet sendt?
{
$text = strip_tags($_POST['text']); //Teksten i selve filen skal være der hvor ´text´står. (Efter POST)
$file_directory2 = "C:\\wamp\\www\\Tekst/"; //Hvor skal filen ligge?
$file_name2 = $counter;//Hvad filen skal hedde.
$file_ext2 = ".txt"; //Hvilken slags fil den skal være.
$file2 = $file_directory2.$file_name2.$file_ext2; //Hele filnavnet.
$create_file2 = fopen($file2, "w+"); //Laver filen.
if(!$create_file2)
{
die("The post didn´t got submitted, because of error! Try again!");
}
$chmod = chmod($file2, 0755); //set the appropriate permissions.
//attempt to set the permissions
if(!$chmod)
{
echo "Post successfully submitted!";
echo "<a href=".$file.">Your post is here!</a>";
}
//attempt to write basic content to the file
if (fwrite($create_file2, "$text") === FALSE)
{
echo "Error writing to file: ($file)\\n";
}
fclose($create_file2);
}else{ //Formen i Start.htm er ikke blevet sendt!
}
//Her starter PHP siden!!---------------------------------------
if(isset($_POST['submit'])) //Er formen i addfile.htm blevet sendt?
{
$ReplyL = "<p><a href=".$file_name6.$file_ext6.">Reply</a></p>";
$file_directory3 = "C:\\wamp\\www\\Test/"; //Hvor skal filen ligge?
$file_name3 = $counter;//Hvad filen skal hedde.
$file_ext3 = ".php"; //Hvilken slags fil den skal være.
$file3 = $file_directory3.$file_name3.$file_ext3; //Hele filnavnet.
$create_file3 = fopen($file3, "w+"); //Laver filen.
if(!$create_file3)
{
}
$chmod = chmod($file3, 0755); //set the appropriate permissions.
//attempt to set the permissions
if(!$chmod)
{
}
//attempt to write basic content to the file
if (fwrite($create_file3, "<p>$ReplyL</p><p>$over</p><p>$text</p>") === FALSE)
{
echo "Error writing to file: ($file)\\n";
}
fclose($create_file3);
echo "<p>Post successfully submitted!</p>";
echo "<a href=".$file_name3.$file_ext3.">Your post is here!</a>";
echo "<p><a href=".$file_name6.$file_ext6.">Reply</a></p>";
}else{ //Formen i Start.htm er ikke blevet sendt!
}
//Forside-------------------------------
if(isset($_POST['submit'])) //Er formen i addfile.htm blevet sendt?
{
$file_directory5 = "C:\\wamp\\www\\Test/"; //Hvor skal filen ligge?
$file_name5 = "Forside Forum";//Hvad filen skal hedde.
$file_ext5 = ".htm"; //Hvilken slags fil den skal være.
$file5 = $file_directory5.$file_name5.$file_ext5; //Hele filnavnet.
$create_file5 = fopen($file5, "a"); //Laver filen.
if(!$create_file5)
{
}
$chmod = chmod($file5, 0755); //set the appropriate permissions.
//attempt to set the permissions
if(!$chmod)
{
}
//attempt to write basic content to the file
if (fwrite($create_file5, "<p><a href=".$file_name3.$file_ext3.">$over</a></p>") === FALSE)
{
echo "Error writing to file: ($file)\\n";
}
fclose($create_file5);
}else{ //Formen i Start.htm er ikke blevet sendt!
}
//Forside--------------------------------------------------------------
//Reply------------------
if(isset($_POST['reply'])) //Er formen i addfile.htm blevet sendt?
{
$reply = strip_tags($_POST['reply']); //Teksten i selve filen skal være der hvor ´text´står. (Efter POST)
$file_directory4 = "C:\\wamp\\www\\Reply/"; //Hvor skal filen ligge?
$file_name4 = $counter;//Hvad filen skal hedde.
$file_ext4 = ".txt"; //Hvilken slags fil den skal være.
$file4 = $file_directory4.$file_name4.$file_ext4; //Hele filnavnet.
$create_file4 = fopen($file4, "a"); //Laver filen.
if(!$create_file4)
{
die("");
}
$chmod = chmod($file4, 0755); //set the appropriate permissions.
//attempt to set the permissions
if(!$chmod)
{
echo "";
}
//attempt to write basic content to the file
if (fwrite($create_file4, "$reply") === FALSE)
{
echo "Error writing to file: ($file)\\n";
}
fclose($create_file4);
$file_directory3 = "C:\\wamp\\www\\Test/"; //Hvor skal filen ligge?
$file_name3 = $counter2;//Hvad filen skal hedde.
$file_ext3 = ".php"; //Hvilken slags fil den skal være.
$file3 = $file_directory3.$file_name3.$file_ext3; //Hele filnavnet.
$create_file3 = fopen($file3, "a"); //Laver filen.
if(!$create_file3)
{
}
$chmod = chmod($file3, 0755); //set the appropriate permissions.
//attempt to set the permissions
if(!$chmod)
{
}
//attempt to write basic content to the file
if (fwrite($create_file3, "<p>$reply</p>") === FALSE)
{
echo "Error writing to file: ($file)\\n";
}
fclose($create_file3);
echo "<p>Post successfully submitted!</p>";
echo "<a href=".$file_name3.$file_ext3.">Your post is here!</a>";
}else{ //Formen i Start.htm er ikke blevet sendt!
}
//Reply slut----------------------
?>
</body>
</html>
Her er start:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<?php
$folder2 = opendir($whichSection . "C:\\wamp\\www\\Overskrift" . $who . "/");
$counter2 = 1;
while($file = readdir($folder2)){
if($file != '.' && $file != '..'){
}
}
closedir($folder2);
$Rep2 = "Reply";
$file_directory7 = "C:\\wamp\\www\\Test/"; //Hvor skal filen ligge?
$file_name7 = $Rep2.$counter2;//Hvad filen skal hedde.
$file_ext7 = ".php"; //Hvilken slags fil den skal være.
$file7 = $file_directory7.$file_name7.$file_ext7; //Hele filnavnet.
?>
<FORM TARGET="Rep" action="<?php echo $file_name7.$file_ext7; ?>">
<p><textarea rows="10" name="reply" cols="32"></textarea><p><input type="submit" value="Submit" name="REP"><input type="reset" value="Reset" name="B2"></p>
</form>
<p> </td>
<td rowspan="4"> </td>
<td rowspan="4"> </td>
</tr>
<tr>
<td height="96"> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>