Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   PHP (http://www.programmingforums.org/forum29.html)
-   -   Organizing my file upload system and BBS.. im lost. (http://www.programmingforums.org/showthread.php?t=12373)

TCStyle Jan 14th, 2007 3:12 PM

Organizing my file upload system and BBS.. im lost.
 
http://tricitystyle.com/shout/

A quick overview of my situation: I want to make a user based file upload system. For each file uploaded (only .jpg are accepted), I want it to have it's "own page" with it's own comment system. Now, I already have the comment system scripted. Heres what that page looks like:
:

        <?
        mysql_connect("...", "...", "...") or die(mysql_error());
        mysql_select_db("...") or die(mysql_error());
        $bbsId = $_GET['id'];
       
        // part1
        if (!ereg("^[0-9]+$", $bbsId)) {
                die ("Invalid id!");
        }
       
        // part2
        if ($bbsId == 1) {
                echo "<img src='content/1.jpg' width='600' height='450'>";
        } elseif ($bbsId == 2) {
                echo "<img src='content/2.jpg' width='600' height='450'>";
        } elseif ($bbsId == 3) {
                echo "<img src='content/3.jpg' width='600' height='450'>";
        } else {
                die("Invalid id!");
        }
       
        // part3
        echo "<table width='600' bgcolor='#000000'><tr><td align='center'><font color='#FFFFFF'><b>Comments:</b></font></td></tr></table>";
        $result = mysql_query("SELECT * FROM BBS WHERE bbsId='" . $bbsId . "' ORDER BY postId DESC") or die(mysql_error());
        while ($row = mysql_fetch_array($result)) {
                        echo "<font ><b>".$row['uName'].": </b></font><font color='" . $row['tColor'] . "'>" . wordwrap($row['uText'], 80, "<br />", 1) . "</font>";
                        echo "<hr align='center' width='600' />";
        }
        ?>


Now, this script gets an id, and only selects data from the column with that id (so that each file has it's own comment system).

My problem: I want to add a file upload system. How can I integrate it with this script? How should I organize the file upload system? Sorry if I'm not being clear, but it's hard to communicate my problem.


All times are GMT -5. The time now is 1:52 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC