killmaster
11-01-2001, 11:00 PM
ok well here are the problems.
1. I have a problem with my config file
here is the script
<? $password = "password"; $username = "username" ? >
says there is a pass error on line 8??
anyhoo here is the script I am now using to post news
<?php
include ("config.php");
if($your_password=="$password")
if($your_name=="$username"){
$your_date = date("M j, Y h:i:s");
$fp=fopen("./comments.dat", "a");
fputs($fp, "<tr><td>Posted by <a href=mailto:$your_email>$your_name</a> at $your_date</td></tr><tr><td>$your_comments</td></tr>");
fclose($fp);
include "comments.php";
$fp .= fread($fp, filesize("./comments.dat"));
fclose($en_file);
}
else{
echo"Incorrect username or password.<br>";
}
?>
now there are a couple of problems with this script. When it was working the date script wasn't. It was saying there where errors
also when you try and view the news it comes up with these errors.
Warning: Supplied argument is not a valid File-Handle resource in /home/samcoleb/public_html/viewsnewz.php on line 154
Warning: Supplied argument is not a valid File-Handle resource in /home/samcoleb/public_html/viewsnewz.php on line 155
now her is the code for that view news script
<?php
echo "<table cellspacing=0 cellpadding=3 border=0>";
include "comments.dat";
$fp = fread($fp, filesize("./comments.dat"));
fclose($fp);
echo "</table>";
?>
I have checked a few errors beena ble to fix them, now with these new ones I can't figure em out.
If you need to know this is for a news script located at http://216.118.121.28/snewz.php which I am currently making
thanks
cya
1. I have a problem with my config file
here is the script
<? $password = "password"; $username = "username" ? >
says there is a pass error on line 8??
anyhoo here is the script I am now using to post news
<?php
include ("config.php");
if($your_password=="$password")
if($your_name=="$username"){
$your_date = date("M j, Y h:i:s");
$fp=fopen("./comments.dat", "a");
fputs($fp, "<tr><td>Posted by <a href=mailto:$your_email>$your_name</a> at $your_date</td></tr><tr><td>$your_comments</td></tr>");
fclose($fp);
include "comments.php";
$fp .= fread($fp, filesize("./comments.dat"));
fclose($en_file);
}
else{
echo"Incorrect username or password.<br>";
}
?>
now there are a couple of problems with this script. When it was working the date script wasn't. It was saying there where errors
also when you try and view the news it comes up with these errors.
Warning: Supplied argument is not a valid File-Handle resource in /home/samcoleb/public_html/viewsnewz.php on line 154
Warning: Supplied argument is not a valid File-Handle resource in /home/samcoleb/public_html/viewsnewz.php on line 155
now her is the code for that view news script
<?php
echo "<table cellspacing=0 cellpadding=3 border=0>";
include "comments.dat";
$fp = fread($fp, filesize("./comments.dat"));
fclose($fp);
echo "</table>";
?>
I have checked a few errors beena ble to fix them, now with these new ones I can't figure em out.
If you need to know this is for a news script located at http://216.118.121.28/snewz.php which I am currently making
thanks
cya