Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A PHP Question. (I think this should be a series. :P)
#1
How do you make a tagboard\shoutbox in PHP.

Yess! I've waited so long to be able to ask that question!
Reply
#2
I asked that question once. I suggest you go get a pre-made one. Here is the one I tried to make, but since Comcast doesn't like PHP or CGI, I had to stop.
size=9]"To announce that there must be no criticism of the president, or that we are to stand by the president, right or wrong, is not only unpatriotic and servile, but is morally treasonable to the American public." -- Theodore Roosevelt[/size]
Reply
#3
First: Learn PHP, so you can do simple programs (on websites). then you will see that the syntax (like "if" or "for") is very similair to C.
Second: Think about what to do for a tagboard.
Third:Code it in PHP (if you want to try your thinkings from step 2 try it first in QB or any other language you can code in)

But here's an example I coded some seconds ago:
Code:
<html>
<body>
<form action=forum.php method=post>
<table border=0>
<tr>
  <td>
   Name:
  </td>
  <td>
   <INPUT TYPE=text NAME=name maxlength=12 size=12>
  </td>
</tr>
<tr>
  <td>
   Message:
  </td>
  <td>
   <INPUT TYPE=text NAME=message maxlenght=200 size=40>
  </td>
</tr>
<tr>
  <td>
   <input type=submit value=post>
  </td>
</tr>
</table>
</form>
<table border=1>
<?php
if ($name!="" && $message!="")
{
  $fpa=fopen("data.dat","a");
  fputs($fpa,stripslashes($name));
  fputs($fpa,";");
  fputs($fpa,stripslashes($message));
  fputs($fpa,";");
  fclose($fpa);
}
$data = "data.dat";
$fpr = fopen($data,"r");
while($zeile = fgetcsv($fpr,200,";"))
{
for($x=0;$x<count($zeile);$x+=2)
{
  echo "<tr><td>";
  echo $zeile[$x];
  echo "</td><td>";
  echo $zeile[$x+1];
  echo "</td></tr>";
}
echo "<br>";
}
fclose($fpr);
?>
</table>
</body>
</html>
For this code you need a file named "data.dat" (without the quotes) which contains data like that
Code:
akOOma;Welcome to my new board;
Rockman;Wow, this is cool;
akOOma;Yeah, thanx Rockman;

If you have questions because of the code, ask me
B 4 EVER
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)