imes_bedo Posted May 26, 2007 Share Posted May 26, 2007 I'm back again... the unexperienced PHP-er. Well... I got the uploader to work again. I just needed to re-do the entire table on MYSQL coz I made a mistake the first time. But now, my uploads won't show up on the list. They are uploaded to the upload folder but it doesn't show up on the website. Here's the code. Hope you can help me. <?php session_start(); require "../_db/sql.php"; require "../_display.php";?><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>imes :: downloads</title> <script type="text/javascript" src="../_script/_formChecker.js"></script> </head> <body> <?php if($_SESSION["user_login"]=="yes"){ $folder_id=$_REQUEST["folder"]; mysql_connect($host_name,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM file where folder_id='$folder_id' ORDER BY file_id DESC;"; $result=mysql_query($query); $num=@mysql_numrows($result); mysql_close(); $i = 0; ?> <table border="0" width="70%" align="center"> <tr> <td colspan="2" width="970" height="10"> <img src="../imes_navi2.png" usemap="#imes_navi2" alt="" style="border-style:none"> <map id="imes_navi2" name="imes_navi"> <area shape="poly" coords="84,82,60,120,155,120,179,82" href="../imes_home.php" title /> <area shape="poly" coords="185,82,175,99,325,99,334,82" href="../imes_about.php" title /> <area shape="poly" coords="342,82,332,99,477,99,486,82" href="../imes_events.php" title /> <area shape="poly" coords="496,82,486,99,640,99,649,82" href="../imes_downloads.php" title /> <area shape="poly" coords="659,82,649,99,811,99,821,82" href="../imes_forum.php" title /> <area shape="poly" coords="173,102,163,120,311,120,323,102" href="../imes_officers.php" title /> <area shape="poly" coords="330,102,320,120,464,120,474,102" href="../imes_picture.php" title /> <area shape="poly" coords="484,102,473,120,626,120,637,102" href="../imes_links.php" title /> <area shape="poly" coords="646,102,636,120,799,120,808,102" href="../imes_thanks.php" title /> <area shape="poly" coords="634,123,624,138,786,139,796,123" href="../imes_logout.php" title /> <area shape="rect" coords="398,22,825,41" href="../imes_about.php" title /> <area shape="rect" coords="565, 46, 820, 60" href="http://www.dlsu.edu.ph" title /> <area shape="rect" coords="838,17,958,138" href="../imes_home.php" title /> <area shape="default" nohref="nohref" alt="" /> </map></td> </tr> <tr> <td height="20" align="left" class="t1" colspan="1" width="334"> <font color="#666666" face="Century Gothic" size="1"><b> Welcome, <?php echo $_SESSION["user_fname"]." ".$_SESSION["user_lname"]; ?>!</b></font></td> <font></font> <td height="20" colspan="1" align="right" class="t1" width="65%"> <font color="#666666" face="Century Gothic" size="1"><b><?php echo "Today is "; print date("l F d, Y h:i a");?> </b></font></td> </tr> <tr> <td colspan="2"> <p align="center"><b><font face="Verdana" size="2" color="#666666"> .: DOWNLOADS :.</font></b></p> </td> </tr> <form action="pro_picture_delete.php" method="post" name="form1"> <tr> <td colspan="2"> <table width="742" border="0" cellspacing="0" cellpadding="0" height="100%"> <tr> <td width="246"></td> <td colspan="2" class="v2" height="100%" valign="top"> <p align="center"><font color="#666666"><b>[click to view files</b></font><b><font color="#666666">]</font></b></p> <table width="102%" id="table1" align="right"> <tr class="v2"> <td width="4%"><?php if($num>0) { ?> <input type="checkbox" name="to[]1" onclick="checkboxes(this.form)" value="check"><?php } ?></td> <td width="73%"><font color="#666666"><b>Downloads</b></font></td> <td width="22%" align="center"> <font color="#666666"><b>Date Created</b></font></td> </tr> <tr class="v1"> <td colspan="2" class="list1"> </td> </tr> <?php if($num<1) {?> <tr class="v2"> <td colspan="2" align="center" height="22"> <font color="#666666"> [no files]</font></td> </tr> <?php } ?> <?php while ($i < $num) { $temp_date = mysql_result($result,$i,"date_created"); ?> <tr class="v2"> <td width="4%"> <input type="checkbox" name="to[]" value="<?php echo mysql_result($result,$i,'file_id'); ?>"></td> <td width="73%" align="left"> <a class="list" href="view_specific_picture.php?picture=<?php echo mysql_result($result,$i,"file_id");?>&folder=<?php echo $folder_id ?>"> <font size="2" color="#666666"><b><?php echo mysql_result($result,$i,"file_title"); ?></font></a></b></td> <td width="22%" align="center"> <font size="2" color="#666666"><?php echo monthNumToWholeName(getMonth($temp_date))." ".getDay($temp_date).", ".getYear($temp_date); ?></font></td> </font> </tr> <?php $i++; } ?> <tr> <td colspan="3"><?php if($num>0) { if ($_SESSION["user_type1"]== "admin") { ?><button type="Button" onclick="return(deletePic())" class="whitebutton">Delete File/s</font></button> <?php } }?><font color="#FF0000" size="1"><?php echo $_SESSION["delete_picture"]; $_SESSION["delete_picture"]="";?> </font><input type="hidden" name="folder_id" value="<?php echo $folder_id;?>"> </td> </td> </tr> <tr class="v1"> <td colspan="3" class="list1"> </td> </tr> <tr> <td colspan="2" height="40"><b><a href="../imes_downloads.php"><font face="Verdana" size="2" color="#666666">back to folders</font></b></a> <?php if ($_SESSION["user_type1"]== "admin"){?> <font face="Verdana" size="2" color="#666666"> : </font> <b><a href="add_picture.php?folder=<?php echo $folder_id ?>"><font face="Verdana" size="2" color="#666666">add file</font></b></a></td> </tr> <?php } ?> </table> </td> </tr> </table> </td> </tr> </tr> <tr> <td colspan="2"> <p align="center"><font face="Verdana" size="2" color="#666666"><br> <br> <br> </font><font color="#999999" size="2"> <span style="font-family: Verdana">dlsu imes :: chrisalx.tc :: 0607</span></font></p> </td> </tr> </form> </table> <?php } else {?> <table border="0" width="70%" align="center"> <tr> <td colspan="2" width="996"></td> <img src="../imes_navi.png" usemap="#imes_navi" alt="" style="border-style:none"> <map id="imes_navi" name="imes_navi"> <area shape="poly" coords="81,110,58,148,153,148,175,110" href="../imes_home.php" title /> <area shape="poly" coords="183,110,173,127,322,127,333,110" href="../imes_about.php" title /> <area shape="poly" coords="340,110,330,127,475,127,485,110" href="../imes_events.php" title /> <area shape="poly" coords="494,110,484,127,637,127,647,110" href="../imes_downloads.php" title /> <area shape="poly" coords="657,110,647,127,809,127,818,110" href="../imes_forum.php" title /> <area shape="poly" coords="171,131,161,148,309,148,320,131" href="../imes_officers.php" title /> <area shape="poly" coords="328,131,317,148,461,148,472,131" href="../imes_picture.php" title /> <area shape="poly" coords="482,131,472,148,624,148,634,131" href="../imes_links.php" title /> <area shape="poly" coords="644,131,634,148,796,148,806,131" href="../imes_thanks.php" title /> <area shape="rect" coords="397,51,822,70" href="imes_about.php" title /> <area shape="rect" coords="564,74,818,88" href="http://www.dlsu.edu.ph" title /> <area shape="rect" coords="839,30,959,150" href="imes_home.php" title /> <area shape="default" nohref="nohref" alt="" /> </map> </tr> <tr> <td> <p align="center"><br /> <br /> <img border="0" usemap="#log" alt="" style="border-style:none" src="../login_first.png" width="967" height="204" /><br /> <map id="log" name="log"> <area shape="rect" coords="812,135,927,164" href="imes_home.php" title /> </map><br /> </p> </td> </tr> <tr> <td> <p align="center"><font face="Verdana" size="2" color="#666666"><br /> <br /> <br /> </font><font color="#999999" size="2"> <span style="font-family: Verdana">dlsu imes :: chrisalx.tc :: 0607</span></font></p> </td> </tr> </table> <?php } ?> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/53023-my-upload-isnt-on-the-list/ Share on other sites More sharing options...
imes_bedo Posted May 26, 2007 Author Share Posted May 26, 2007 still need help. ??? Quote Link to comment https://forums.phpfreaks.com/topic/53023-my-upload-isnt-on-the-list/#findComment-262107 Share on other sites More sharing options...
imes_bedo Posted May 28, 2007 Author Share Posted May 28, 2007 shameless bump Quote Link to comment https://forums.phpfreaks.com/topic/53023-my-upload-isnt-on-the-list/#findComment-263226 Share on other sites More sharing options...
MadTechie Posted May 28, 2007 Share Posted May 28, 2007 try moving mysql_close(); to the end (when you finished with it) Quote Link to comment https://forums.phpfreaks.com/topic/53023-my-upload-isnt-on-the-list/#findComment-263232 Share on other sites More sharing options...
imes_bedo Posted May 28, 2007 Author Share Posted May 28, 2007 nope... it didn't work. T__T Hmm... is there any chance that there is something wrong with the add file coding? coz only the first file I uploaded shows up on the list. <?php session_start(); require "../_db/sql.php"; require "../_display.php"; ?><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>imes :: pictures</title> <script type="text/javascript" src="../_script/_formChecker.js"></script> </head> <body> <?php if($_SESSION["user_login"]=="yes"){ $folder_id=$_REQUEST["folder"]; ?> <table border="0" width="70%" align="center"> <tr> <td colspan="2" width="970" height="10"> <img src="../imes_navi2.png" usemap="#imes_navi2" alt="" style="border-style:none"> <map id="imes_navi2" name="imes_navi"> <area shape="poly" coords="84,82,60,120,155,120,179,82" href="../imes_home.php" title /> <area shape="poly" coords="185,82,175,99,325,99,334,82" href="../imes_about.php" title /> <area shape="poly" coords="342,82,332,99,477,99,486,82" href="../imes_events.php" title /> <area shape="poly" coords="496,82,486,99,640,99,649,82" href="../imes_downloads.php" title /> <area shape="poly" coords="659,82,649,99,811,99,821,82" href="../imes_forum.php" title /> <area shape="poly" coords="173,102,163,120,311,120,323,102" href="../imes_officers.php" title /> <area shape="poly" coords="330,102,320,120,464,120,474,102" href="../imes_picture.php" title /> <area shape="poly" coords="484,102,473,120,626,120,637,102" href="../imes_links.php" title /> <area shape="poly" coords="646,102,636,120,799,120,808,102" href="../imes_thanks.php" title /> <area shape="poly" coords="634,123,624,138,786,139,796,123" href="../imes_logout.php" title /> <area shape="rect" coords="398,22,825,41" href="../imes_about.php" title /> <area shape="rect" coords="565, 46, 820, 60" href="http://www.dlsu.edu.ph" title /> <area shape="rect" coords="838,17,958,138" href="imes_home.php" title /> <area shape="default" nohref="nohref" alt="" /> </map></td> </tr> <tr> <td height="20" align="left" class="t1" colspan="1" width="334"> <font color="#666666" face="Century Gothic" size="1"><b> Welcome, <?php echo $_SESSION["user_fname"]." ".$_SESSION["user_lname"]; ?>!</b></font></td> <font></font> <td height="20" colspan="1" align="right" class="t1" width="65%"> <font color="#666666" face="Century Gothic" size="1"><b><?php echo "Today is "; print date("l F d, Y h:i a");?> </b></font></td> </tr> <tr> <td colspan="2"> <p align="center"><b><font face="Verdana" size="2" color="#666666">.: Downloads :.</font></b></p> </td> </tr> <tr class="v1"> <td colspan="2" class="list1"> </td> </tr> <tr> <td colspan="2"> <p align="center"><b><font face="Verdana" size="2" color="#666666">Add File</font></b></p> </td> </tr> <form action="pro_picture_add.php" ENCTYPE="multipart/form-data" method="post" name="form2"> <tr> <td colspan="2"> <table width="35%" id="table1" align="center"> <tr> <td class="v2" valign="top"> <p align="justify"><b> <font face="Verdana" size="2" color="#666666">File Name:</font></b><br> <!--webbot bot="Validation" s-data-type="String" b-value-required="TRUE" i-maximum-length="50" --><input type="text" name="file_title" class="whitebutton" size="30" maxlength="50"><p align="justify"><b> <font face="Verdana" size="2" color="#666666">File</font></b><font color="#666666">:</font><br> <input type="file" name="file_name" class="whitebutton" size="31" maxlength="50"></p> <font size="2" color="#666666" face="Tahoma"> </font></p><input type="hidden" name="folder_id" value="<?php echo $folder_id;?>"> <input name="file_date_u" id="file_date_u" value="<?php echo date("Ymdhis"); ?>" size="39" type=hidden maxlength=30> <button class="whitebutton" type="submit"> <font face="Verdana">Post File</font></button> <button onclick="return(onlineCancel());" class="whitebutton" type="button"> <font face="Verdana">Cancel</font></button></p> <p align="justify"> </p> </td> </tr> </table> </td> </tr> </form> </table> </td> </tr> </tr> <tr> <td colspan="2"> <p align="center"><font face="Verdana" size="2" color="#666666"><br> <br> <br> </font><font color="#999999" size="2"><span style="font-family: Verdana">dlsu imes :: chrisalx.tc :: 0607</span></font></p> </td> </tr> </form> </table> <?php } else {?> <table border="0" width="70%" align="center"> <tr> <td colspan="2" width="996"></td> <img src="../imes_navi.png" usemap="#imes_navi" alt="" style="border-style:none"> <map id="imes_navi" name="imes_navi"> <area shape="poly" coords="81,110,58,148,153,148,175,110" href="../imes_home.php" title /> <area shape="poly" coords="183,110,173,127,322,127,333,110" href="../imes_about.php" title /> <area shape="poly" coords="340,110,330,127,475,127,485,110" href="../imes_events.php" title /> <area shape="poly" coords="494,110,484,127,637,127,647,110" href="../imes_downloads.php" title /> <area shape="poly" coords="657,110,647,127,809,127,818,110" href="../imes_forum.php" title /> <area shape="poly" coords="171,131,161,148,309,148,320,131" href="../imes_officers.php" title /> <area shape="poly" coords="328,131,317,148,461,148,472,131" href="../imes_picture.php" title /> <area shape="poly" coords="482,131,472,148,624,148,634,131" href="../imes_links.php" title /> <area shape="poly" coords="644,131,634,148,796,148,806,131" href="../imes_thanks.php" title /> <area shape="rect" coords="397,51,822,70" href="../imes_about.php" title /> <area shape="rect" coords="564,74,818,88" href="http://www.dlsu.edu.ph" title /> <area shape="rect" coords="839,30,959,150" href="../imes_home.php" title /> <area shape="default" nohref="nohref" alt="" /> </map> </tr> <tr> <td> <p align="center"><br /> <br /> <img border="0" usemap="#log" alt="" style="border-style:none" src="../login_first.png" width="967" height="204" /><br /> <map id="log" name="log"> <area shape="rect" coords="812,135,927,164" href="imes_home.php" title /> </map><br /> </p> </td> </tr> <tr> <td> <p align="center"><font face="Verdana" size="2" color="#666666"><br /> <br /> <br /> </font><font color="#999999" size="2"> <span style="font-family: Verdana">dlsu imes :: chrisalx.tc :: 0607</span></font></p> </td> </tr> </table> <?php } ?> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/53023-my-upload-isnt-on-the-list/#findComment-263241 Share on other sites More sharing options...
MadTechie Posted May 28, 2007 Share Posted May 28, 2007 in the first chunk of code.. your not setting $folder_id etc.. infact i can't see a single time you fetch the data! Quote Link to comment https://forums.phpfreaks.com/topic/53023-my-upload-isnt-on-the-list/#findComment-263245 Share on other sites More sharing options...
imes_bedo Posted May 28, 2007 Author Share Posted May 28, 2007 And... coz I'm incredibly stupid [yes, i truly am]... can you tell me what to do? Funny thing is... this code was actually made to upload pictures. i just changed it around to upload document files instead. and this worked perfectly as a picture uploader. Quote Link to comment https://forums.phpfreaks.com/topic/53023-my-upload-isnt-on-the-list/#findComment-263256 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.