Tuesday, 28 August 2018
Subscribe to:
Post Comments (Atom)
<?php
$user_list=file('users.txt');
$n=0;
foreach ($user_list as $user[$n]) {
if(!file_exists("Users/".$_POST[username]."-".$user[$n].".php")){
$file_c=fopen("Users/".$_POST[username]."-".$user[$n].".php", 'a+');
fwrite($file_c,"Content");
}
$n++;
}
?>
fwrite()
, need to be close file handler by fclose()
after writing file was completed:<?php
$user_list=file('users.txt');
foreach ($user_list as $user) {
if(!file_exists("Users/".$_POST[username]."-".trim($user).".php")){
$file_c=fopen("Users/".$_POST[username]."-".trim($user).".php", 'a');
fwrite($file_c,"Content");
fclose($file_c);
}
}
?>
Hello Friends! I am Ramana a part time blogger from Hyderabad.
0 comments:
Post a Comment