Qbasicnews.com
July 08, 2020, 08:35:42 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: A PHP Question. (I think this should be a series. :P)  (Read 1515 times)
Rokkuman
Na_th_an
*****
Posts: 1973



« on: March 15, 2003, 10:02:12 PM »

How do you make a tagboard\shoutbox in PHP.

Yess! I've waited so long to be able to ask that question!
Logged
pr0gger
I hold this place together
*****
Posts: 775


« Reply #1 on: March 15, 2003, 10:23:28 PM »

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

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]
ak00ma
Ancient Guru
****
Posts: 669



« Reply #2 on: March 16, 2003, 04:59:21 AM »

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 &#40;$name!="" && $message!=""&#41;
&#123;
  
$fpa=fopen&#40;"data.dat","a"&#41;;
  
fputs&#40;$fpa,stripslashes&#40;$name&#41;&#41;;
  
fputs&#40;$fpa,";"&#41;;
  
fputs&#40;$fpa,stripslashes&#40;$message&#41;&#41;;
  
fputs&#40;$fpa,";"&#41;;
  
fclose&#40;$fpa&#41;;
&#125;
$data "data.dat";
$fpr fopen&#40;$data,"r"&#41;;
while&#40;$zeile = fgetcsv&#40;$fpr,200,";"&#41;&#41;
&#123;
 
for&#40;$x=0;$x<count&#40;$zeile&#41;;$x+=2&#41;
 
&#123;
  
echo "<tr><td>";
  echo 
$zeile[$x&#93;;
  
echo "</td><td>";
  echo 
$zeile[$x+1&#93;;
  
echo "</td></tr>";
 &
#125;
 
echo "<br>";
&
#125;
fclose&#40;$fpr&#41;;
?>

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

B 4 EVER
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!