Php Link Tracker Help Creating a file and inserting code into it.?

Findd Online

New member
I have two questions but first I'll give you what I got. This is just part of the whole program.
$Random_Number = rand(100,100000000000);
$Check_Number = mysql_query("SELECT * FROM products WHERE randomnumber='$Random_Number'");
$Check_Final = mysql_num_rows($Check_Number);

while($Check_Final != '0')
{
$Random_Number = rand(100,100000000000);
}

$Create_File = fopen($Random_Number . '.php','w')
fwrite($Create_File,"
<?php



?>
");

I want to make sure that fopen will create a file and also open it.
Next, in fwrite I want to include a variable that is in my code above it like
fwrite($Create_File,"
<?php

<code>$Username</code>

?>");

The only thing is that the variable $username is a POST form field so how do I include that in the file I'm creating?
 
Back
Top