Results 1 to 1 of 1

Thread: help with mysql functions wuthin phpbb

  1. #1
    Join Date
    May 2007
    Posts
    6

    Exclamation help with mysql functions within phpbb

    I am trying to make some sort of a file hosting website, along with forums and e-mail. i am using phpbb and decided to integrate the phpbb login with my file hosting. For the index_body.tpl page, I am trying to select a table of values (to display the files that the user has uploaded) and it is not reading my php script, but instead acting as if it was an html code

    Here is my code:
    PHP Code:
    <table width="100%" cellspacing="0" cellpadding="2" border="0" align="center">
      <tr> 
        <td>
    <?php
    define
    ('IN_PHPBB'true);
    $phpbb_root_path './forum/';
    include(
    $phpbb_root_path 'extension.inc');
    include(
    $phpbb_root_path 'common.'.$phpEx);

    //
    // Start session management
    //
    $userdata session_pagestart($user_ipPAGE_INDEX);
    init_userprefs($userdata);
    //
    // End session management
    //

    if ( $userdata['session_logged_in'] )
    {
    ?>
    <table align="left" border="1">
    <tr bgcolor="#0000FF"><td><b>File Name</b></td><td><b>Download</b></td></tr>
    <?
    $bgcolor
    ="#0000FF";
    $username=$userdata['username'];
    mysql_connect('localhost''bull1991_phpb1''d96mP{gR1Ksp') or die(mysql_error());
    mysql_select_db('bull1991_phpb1') or die(mysql_error());
    $query  "SELECT filename, target path, username FROM files WHERE username='$username'";
    $result mysql_query($query);
    while(
    $row mysql_fetch_array($result))
    {
    ?>
    <tr bgcolor="#0000FF"><td width="500">
    <?
    Print $row['filename'];
    ?></td><td>
    <a href="
    <?
    Print $row['target path'];
    ?>
    ">Download</a></td></tr>
    <?
    }

    ?>
    Max Upload Size For One File Is 2mb
    <br><br>
    <form enctype="multipart/form-data" action="uploadprocess.php" method="POST">
    <input type="hidden" name="username" value="
    <?
    Print $userdata['username'];
    ?>">
    <input type="hidden" name="MAX_FILE_SIZE" value="100000000">
    Choose a file to upload: <input name="uploadedfile" type="file"><br>
    Name File: <input type="text" name="filename"><br>
    <input type="submit" value="Upload">
    </form>
    <?
    }
    ?>


    </td>  </tr>
    </table>
    When I access the home page, it does not show what I have in my mysql database, but instead it shows a row in the table that has no title, and a link that syas download that points to:
    http://www.informationpath.net/filehosting/%3C?Print $row['filename'];?>

    Does anyone know how to fix this?
    Last edited by bull1991; 23 May 2007 at 04:08 PM.

Similar Threads

  1. New Free MySQL GUI
    By expert-database in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 1
    Last Post: 21 Dec 2006, 05:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •