Jump to content


Photo

PHP in tables?


  • Please log in to reply
5 replies to this topic

#1 fert

fert
  • Members
  • PipPipPip
  • Advanced Member
  • 1,114 posts

Posted 30 June 2006 - 07:16 AM

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

Si hoc legere scis nimium eruditionis habes
Gentoo Linux 2007.0 Firefox 2

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 30 June 2006 - 07:21 AM

POST YOUR CODE OK!

As a guess i bet you havent used the correct while loop array/assoc statement lets see ha.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 fert

fert
  • Members
  • PipPipPip
  • Advanced Member
  • 1,114 posts

Posted 30 June 2006 - 07:24 AM

<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>


Si hoc legere scis nimium eruditionis habes
Gentoo Linux 2007.0 Firefox 2

#4 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 30 June 2006 - 07:43 AM


Try the echo the below way.

echo $somethink;

not

echo "$varable";
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#5 fert

fert
  • Members
  • PipPipPip
  • Advanced Member
  • 1,114 posts

Posted 30 June 2006 - 07:54 AM

Thanks now it works now  :)

Si hoc legere scis nimium eruditionis habes
Gentoo Linux 2007.0 Firefox 2

#6 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 30 June 2006 - 07:56 AM

all the best mate.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users