Current location: Hot Scripts Forums » Programming Languages » PHP » Forum Help


Forum Help

Reply
  #1 (permalink)  
Old 04-29-07, 04:34 AM
connor connor is offline
Wannabe Coder
 
Join Date: Apr 2005
Location: Knob Noster, Mo
Posts: 228
Thanks: 1
Thanked 0 Times in 0 Posts
Exclamation Forum Help

Ok, so I am making a forum system for my website and I can't get this script:

PHP Code:

$topic_id $_REQUEST['topic_id'];
$sqla="SELECT * FROM ".$tablepre."forum_post WHERE topic_id='".$topic_id."' ORDER BY id DESC";
$qa = @mysql_query($sqla) or die("Cannot connect to table (".$tablepre."forum_topic).");
while(
$rowa = @mysql_fetch_array($qa))
     {
    
$author .= $rowa['author'];
    
$sqlb="SELECT * FROM ".$tablepre."users WHERE id='".$author."'";
    
$qb = @mysql_query($sqlb) or die("Cannot connect to table (".$tablepre."users (Author)).");
    while(
$rowb = @mysql_fetch_array($qb))
         {
        
$posts .= "<table id='full_border' align='center' width='100%'>
                             <tr>
                         <td align='left'><center><b><u>Author Info</u></b></center>
                         By:&nbsp;"
.$rowb['username']."<br>
                         Status:&nbsp;"
;
                         if(
$rowb['status']=="Admin"){
                             
$posts .="Administrator";
                         }else
                         if(
$rowb['status']=="Staff"){
                             
$posts .="Staff Member";
                         }else
                              if(
$rowb['status']=="User"){
                             
$posts .="Site User";
                         }
        
$posts .= "<br>
                 Date:&nbsp;"
.$rowa['pdate']."<br>
                 Time:&nbsp;"
.$rowa['ptime']."
                 </td>
                 <td align='left'>&raquo;"
.$rowa['subject']."<hr>".$rowa['post']."</td>
                      </tr>
                  </table>"
;
    }
}
echo 
"<table id='no_border' align='center' width='100%'>
             <tr>
            <td>"
.$posts."</td>
         </tr>
      </table>"

To show more than one post, can anyone help me with this issue?
__________________
Connor Strandt
JCS Photography
www.JCStrandt.com

Last edited by connor; 04-29-07 at 04:37 AM.
Reply With Quote
  #2 (permalink)  
Old 04-29-07, 07:05 PM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,515
Thanks: 20
Thanked 109 Times in 106 Posts
Connor,

Unless you are building a forum to learn how to build one, I would recommend finding one and using it.

Life is too short to reinvent the wheel. There are many great forums available, for free, many times they are included with hosting.

You can go to hotscripts.com, or Google to find them.

Good luck
Reply With Quote
  #3 (permalink)  
Old 04-29-07, 07:08 PM
connor connor is offline
Wannabe Coder
 
Join Date: Apr 2005
Location: Knob Noster, Mo
Posts: 228
Thanks: 1
Thanked 0 Times in 0 Posts
I am wanting to learn how to make one, + I want my site to be completely custom.
__________________
Connor Strandt
JCS Photography
www.JCStrandt.com
Reply With Quote
  #4 (permalink)  
Old 04-30-07, 10:25 AM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,515
Thanks: 20
Thanked 109 Times in 106 Posts
Learn how to customize an existing forum.

It is not worth building one from scratch.
Reply With Quote
  #5 (permalink)  
Old 04-30-07, 01:29 PM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
PHP Code:

$topic_id $_REQUEST['topic_id'];
$sqla="SELECT * FROM ".$tablepre."forum_post WHERE topic_id='".$topic_id."' ORDER BY id DESC";
$qa = @mysql_query($sqla) or die("Cannot connect to table 
Guess what happens if I figure out your table prefix and then submit a query string something like this:

PHP Code:

http://domain.com?script.php?topic_id=;DROP tableprefix.forum_post 

That's right, your table goes bye-bye. This is why you should listen to what others here are telling you. Writing your own forum from scratch is a BAD IDEA. Customize an existing forum, or I can practically guarantee you'll regret it. Learn from the mistakes of others, don't repeat them.
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking for Forum Boosters to help us out! longlam Job Offers & Assistance 0 04-12-06 07:10 PM
.::Figure This::. Community Forum grand merlin General Advertisements 1 01-01-06 08:20 PM
Free phpBB Forum Hosting - Jconserv's FFH Network Psan General Advertisements 0 05-13-05 05:30 PM
Free phpbb forum hosting service with 250 skins and 41 languages edkhosting General Advertisements 2 10-13-04 10:54 PM


All times are GMT -5. The time now is 06:02 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.