I am trying to write to a php file, but I don't know how to avoid "printing" of a variable; I just want to print it as it is, not its value... Is this possible?!
Well, however, here's the code:
<?php
// Name has been specified in a form on the previous page
$name = "UserChoice";
if(file_exists("userfiles/$name.php")
{
echo "File exists. Try again!";
}
else
{
$create = touch("userfiles/$name.php");
$open = fopen("userfiles/$name.php",'w') or die("Couldn't open file $name.php");
// This is where I want it to say "$username = $name", not = "UserChoice"...
$write = fwrite($open,"$username = \"$name\"");
$close = fclose($open);
}
?>
I can take mistakes, so if there are any errors in this code, or if there is no way of doing this, then please tell me!
// Thanx in advance!