Looks like some good code, but how do I go about changing a directory? I want it to go into a totally different directory.
Post in:
/home/voodoo/public_html/ct_license/file_goes_here.dat
From:
/home/voodoo/public_html/clantek/cart/admin/vieworders.php
Also, would this work? $server is the variable grabbed from the form that I want to make the file name out of and the data inside the file.
$variable = $_POST['$server'];
if(file_exists("$variable.dat"))
{
echo "File exists, exiting<br>";
exit;
}
$fp = fopen("$variable.dat", "a+");
if(!$fp)
{
echo "There has been an error creating the file, please try again later on<br>";
exit;
}
fwrite($fp, $variable);
echo $variable;
echo "  succcessfully written into file";
fclose($fp);