Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PHP Filesystem
#1
Code:
<html>
<head>
        <meta charset="utf-8" />
        <title>Wiki Page</title>
    </head>
    <body>
        <h1>
        <?php
        include("rnd.php");
$file = fopen($_GET["Name"];,"w");
fwrite($file,$_GET["body"];);
fclose($file);
include("footer.php");
?>
    </body>
</html>

For some reason, this isn't working.

Any ideas?
Reply
#2
1: Do other PHP scripts work?

2: Does it show an error at all?
Reply
#3
The other PHP scripts do work.

2.M y thing doesn't report PHP errors.
Reply
#4
(07-14-2011, 12:53 AM)roperson Wrote: The other PHP scripts do work.

2.M y thing doesn't report PHP errors.

Put this at the top Tongue


error_reporting(E_ALL);

[Image: AmZJnA9.png]
Reply
#5
You don't need the semicolons after the $_GET variables. They should almost always only go at the end of lines.
Reply
#6
My bad.
Great,now I have another glitch that's been poping up a lot. All the text is HUGE.
No errors, but it won't create the files.

Wait... nvm
Reply
#7
You never closed your <h1> tag.


[Image: chaosthegreat.png]
Reply
#8
Now, this won't work. No matter if I put HTML or not it simply doesn't work.

Code:
<?php
        include("rnd.php");
$file = fopen($_GET["Name"]. ".html","x");
fwrite($file,$_GET["body"]);
fclose($file);
include("footer.php");
?>

Thanks, Chaos.
Reply
#9
$file = fopen($_GET["Name"]. ".html","x"); that line may be wrong. If I remember correctly, you can't have 2 quotes, then more. It confuses php. Try this:
[lua]
$file = fopen($_GET["Name"]. /.html/,/x/);
[/lua]
[Image: chaosthegreat.png]
Reply
#10
Nope, it shout out the 500.0 error. ;p
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)