.html unique site verifcation with download with PHP
Hi i want to make a verification script like the google webmaster tools.
Where you have to download a .html file which has a unique string for each user. then my website calls for that script to ensure the site 开发者_StackOverflow中文版is verified.
heres how I want it to work, in my database i have a field which stores a unique string for each user.
the user then downloads a file with this string
uploads it to their site and my website calls for it.
What i am thinking is when the user presses the download button
$FileName = "veri_".$username.".html";
$fh = fopen($FileName, 'w') or die("can't open file");
$stringData = $ustring;
fwrite($fh, $stringData);
fclose($fh);
how would i go about a user downloading this file and then deleting the file of my server. and is that the best way to do it
unlink("veri_".$username.".html");
header("Location: download.php?file=".$username);
however this has to be at very top before any output
精彩评论