Jump to content

Archived

This topic is now archived and is closed to further replies.

fert

PHP in tables?

Recommended Posts

I'm working on forum code for my website, but the php code i put in the table dosen't work any idea why?

Share this post


Link to post
Share on other sites
POST YOUR CODE OK!

As a guess i bet you havent used the correct while loop array/assoc statement lets see ha.

Share this post


Link to post
Share on other sites
[code]
<table border="1" width="100%">
<tr>
<td><?php //code to see if the topic is open or closed
$file=@fopen("_private/website_Pyrokinetic_1_what_to_post_here_replies.txt","r");
$num=@fread($file,filesize("_private/Pyrokinetic_1_what_to_post_here_status.txt"));
@fclose($file);
                                       if($num=="0")
{
echo "<img border=0 scr=www.usnet1.net/open.jpg alt=\"This thread is closed\">";
}
else
{
echo "<img border=0 scr=www.usnet1.net/lock.jpg alt=\"This thread is open\">";
}


?>
</td>
<td width="511">What to post here<p><font size="1">Pyrokinetic_1</font></td>
<td width="92"><?php //the number of replies
$address="_private/website_Pyrokinetic_1_what_to_post_here_replies.txt";
$file=@fopen($address,"r");
$num=@fread($file,filesize($address));
@fclose($file);

echo "$num";
?>
</td>
<td width="94"><?php //number of views
$file=@fopen("_private/website_Pyrokinetic_1_what_to_post_here_views.txt","r");
$num=@fread($file,filesize("_private/Pyrokinetic_1_what_to_post_here_views.txt"));
@fclose($file);

echo "$num";
?>
</td>
<td width="106"><?php //the date it was posted
$file=@fopen("_private/website_Pyrokinetic_1_what_to_post_here_date.txt","r");
$time=@fread($file,filesize("_private/Pyrokinetic_1_what_to_post_here_date.txt"));
@fclose($file);

echo "$time";
?>
</td>
</tr>
</table>
[/code]

Share this post


Link to post
Share on other sites

Try the echo the below way.

echo $somethink;

not

echo "$varable";

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.