02-27-2010, 08:34 PM
|
#3 (permalink)
|
|
The Contributor
Join Date: Feb 2010
Posts: 69
Thanks: 16
|
great stuff if anyone needs anything like this here is what i come out with and if anyone spots any errors i would appriciate u letting me know :D Thanks
PHP Code:
<?php
$thetag = $_REQUEST["tag"];
//make a random number for the file name
$randnumb = rand(0, 9999999);
//make the file on the server and save it as .txt
$ourFileName = $randnumb . ".txt";
$ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
fclose($ourFileHandle);
//open the file
$myFile = $randnumb . ".txt";
$fh = fopen($myFile, 'w');
//start writing to the file
$stringData = $thetag . "\n";
fwrite($fh, $stringData);
fclose($fh);
//we created the file and input the data to it now give them the URL
$thenewurl = 'file location' . $randnumb . '.txt';
echo 'Your upload was successful.. this is your URL <a href="file location' . $randnumb . '.txt">' . $thenewurl . '</a><BR>Save the url and give it to who you want to!';
?>
|
|
|
|