|
||||||
| PHP Tutorials PHP Tutorials |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
I use this code, and find it works on my server at PHP Version 4.4.8
PHP Code:
|
|
|||
|
With my code you can put "{foldername}/$file" into the code so it will look something like so:
Code:
<?php
$url = $_REQUEST['url'];
if ($url != ''){
$file = isset($_POST['file']) ? $_POST['file']:$url;
$data = $_REQUEST['data'];
$newfile = fopen("tmp/$file", "w+") or die ("could not create file.");
fclose($newfile);
$myfile = @fopen("tmp/$file", "w+") or die ("could not open file.");
@fwrite($myfile, $data) or die ("could not write to file");
fclose($myfile);
$msg = "<p>File created: <a href='$file'>$file</a><br/>Content:<br>$data</p>";
echo $msg;}
else {echo '<form action="?create=go" method="post" name="new">
File name.extention:
<input name="url" type="text" size="30" maxlength="60" /><br/>
File data:
<textarea name="data" size="30" id="data" ></textarea><br/>
<input name="" type="submit" value="CREATE FILE" /></form>';}
?>
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PHP 4 end of life announcement | Jordan | Programming News | 4 | 08-30-2007 10:55 AM |
| Where to Put PHP Code | clookid | PHP Tutorials | 1 | 01-11-2007 09:44 PM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |
Goal: 100,000 Posts
Complete: 97%