Big Trouble in creating and writing a file to disk
| From: | lance at dallypost dot com | Date: | Wed, 02 Aug 2000 12:58:56 +0000 |
| Subject: | Big Trouble in creating and writing a file to disk | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-9748@lists.php.net to get a copy of this message | ||
I am attempting to write a script that will create a new file and store
it on my index page as an html file. The following script is what I
am using and it will not work. Thanks in advance
//open a file
$indexpage = fopen("http://www.dallypost.com/$t_url.$t_extension",
"w");
//make sure open was successfull
if(!($indexpage))
{
print("<FONT face=arial size=$titlefontsize color=$titlefontcolor><B>Error:
</B></FONT>");
print("<FONT face=arial size=$basefontsize color=$titlefontcolor>$t_url.$t_extension
could not be created</FONT>");
exit;
}//endif(!($indexpage))
//write nesessary lines to the file
fputs($indexpage, "<?php\n");
fputs($indexpage, "$t_affiliateid = $t_memberid;\n");
fputs($indexpage, "$t_home =
\"http://www.dallypost.com/rockymountainclassic.htm\";\n");
fputs($indexpage, "require(\"templates/std.php\"); \n");
fputs($indexpage, "$pagename = \"$t_memberid
Home Page\";\n");
fputs($indexpage, "print(\"<HTML>\");\n");
fputs($indexpage, "print(\"<HEAD>\");\n");
fputs($indexpage, "print(\"<TITLE>IARA, Home of
the Rocky Mountain Classic</TITLE>\");\n");
fputs($indexpage, "print(\"</HEAD>\");\n");
fputs($indexpage, "$content = \"index.con\";\n");
fputs($indexpage, "require(\"$template\");\n");
fputs($indexpage, "print(\"</BODY>\");\n");
fputs($indexpage, "print(\"</HTML>\");\n");
fputs($indexpage, "?>\n");
fclose($indexpage);//close the file
Lance Earl