fwrite question
Posted: Thu Jun 24, 2004 6:17 pm
hello,
im trying to write to an htm doc, which will be generated from PHP like so;
now in the above example, the users name is saved with an htm ext, given the user a mini account, without the use of sql, etc... which is what I am trying to avoid... what I would like is to dynamically print a div box and then eventually as the user progresses, the users page will update with new info...
if I can get a confirmation on this one question I feel like I could wing the rest...
so, is it correct to do this:
would that write the div to the user.htm file? I know I could throw the variables in with the html code and use those to help in updating dynamically, so all i want to know is how to write html code to an htm file dynamically via PHP, while passing variables...
thanks in advance
im trying to write to an htm doc, which will be generated from PHP like so;
Code: Select all
// check if pass is correct
$sp = $_GETї'name'];
$perm = $_GETї'pass'];
if(!$sp) {
echo "We're sorry... you must enter a name to login.";
} else {
if($perm == "0"){ //if it's ALL good move to main
//opens file for writing
$fp = fopen("".$sp.".htm","a+");
//write string to htm file
fwrite($fp, $sp);
fclose($fp);if I can get a confirmation on this one question I feel like I could wing the rest...
so, is it correct to do this:
Code: Select all
fwrite($fp, $sp);
echo "<div style="blah" etc...>";
echo "etc...";
fclose($fp);thanks in advance