file handling problem
Posted: Wed Aug 07, 2002 11:26 am
this is suppost to read news files(or create them if they dont exist) and read them into the main file using <iframe> for some reason its not working. you can see the errors it's giving me here http://r85anderson.coolfreepages.com/home.php any ideas of how to fix it? thanks.
Code: Select all
function shout_box() {
echo("\t<td valign=top><table width=550 cellspacing=0 cellpadding=0 border=0 align=center>");
echo("\n\t\t<tr>\n\t\t\t<td align=right><table width=100% cellspacing=0 cellpadding=0 border=0 valign=top align=center>");
echo("\n\t\t<tr>\n\t\t\t<td height=15></td>\n\t\t\t</tr>");
echo("\n\t\t<tr>\n\t\t\t<td><table width=95% cellspacing=0 cellpadding=0 border=0 valign=top align=center>\n\t\t\t</tr>");
$result=mysql_query("SELECT * FROM shout_box");
for($i=0; $i<mysql_num_rows($result); $i++) {
$get=mysql_fetch_array($result);
$pfile="http://".variables2(subdomain).variables2(domain)."/newsdir/".$i.".php";
if(is_file($pfile)) {
fopen($pfile, "r");
echo("<iframe src="".$pfile." frameborder=0 scrolling=auto height=80 width=500></iframe>");
fclose($pfile);
}
else {
fopen($pfile, "w+");
fwrite($pfile, "<table width=100% bgcolor=003333 cellspacing=0 cellpadding=0 border=0>\n\t<tr>\n\t\t<td>".$getї'headline']."</td></tr>");
fwrite($pfile, "<tr><td align=right>".$getї'post']."</td></tr>");
fwrite($pfile, "<tr><td>posted by: ".$getї'name']." | ".$getї'date']."</td></tr></table>");
fclose($pfile);
}
}
echo("</table>\n\t\t\t<tr>\n\t\t\t\t<td> </td>\n\t\t\t\t</tr>\n\t\t\t\t</td>\n\t\t\t</tr></table>\n\t\t</td></tr>");
echo("\n<tr>\n\t<td align=center><a href=http://www.webiam.net target=_blank><font face=".variables2(font)." size=1>© 2002 web i am networks</a></td>\n\t</tr>\n </table>");
}