Upload Not Working

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Upload Not Working

    Hello friends! My upload does not load the images, help! I put the codes of the files, I tried to find the problem but not found.
    index.php
    Code:
    <?php
    include("../web/config.php");
    include("../web/core.php");
    connectdb();
    $site = $_GET["site"];
    
    $sitename = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name=&#39;sitename&#39;"));
    $sitename = $sitename[0];
    $uip = getip();
    $action = $_GET["action"];
    $sid = $_GET["sid"];
    $page = $_GET["page"];
    $who = $_GET["who"];
    $uid = getuid_sid($sid);
    $theme = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE id=&#39;".$uid."&#39;"));
    
    If($site=="wap"){
    header("Content-type: text/vnd.wap.wml");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    print "<?xml version=\"1.0\"?>";
    echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
    }else{
         header("Cache-Control: no-cache, must-revalidate");            // Prevent caching, HTTP/1.1
      header("Pragma: no-cache");
    echo &#39;<?xml version="1.0"?&#39; . &#39;>&#39;; 
    echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
    }
    
    if($site=="wap"){
    echo "<wml>";
    }else{
        echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
    }
    
    /*
    Author : GUMSLONE AND LAMAR
    */
    
    if($site=="wap"){
    echo "<card id=\"main\" title=\"$sitename Uploader™\">";
    }else{
            echo "<head>";
        echo "<title>$sitename Uploader</title>";
        echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        echo "</head>";
        echo "<body>";
    }
    echo mobads();
    echo "<p align=\"left\">";
    
    echo "[b][u]$sitename File Share[/u][/b]
    ";
    //echo "Link To Download Files Eg: [url]http://www.dmpwap.net/uploaded/files/line.gif[/url]
    
    ";
    //pagination code
    
        $limit          = 10;               
        $query_count    = "SELECT id, COUNT(*) FROM ibwf_uploads GROUP BY id";    
        $result_count   = mysql_query($query_count);    
        $totalrows      = mysql_num_rows($result_count); 
    
            if(empty($page)){
            $page = 1;
        }
            
    
        $limitvalue = $page * $limit - ($limit); 
        $query  = "SELECT * FROM ibwf_uploads ORDER BY id DESC LIMIT $limitvalue, $limit";        
        $result = mysql_query($query) or die("Error: " . mysql_error()); 
    
        if(mysql_num_rows($result) == 0){
            echo("Nothing to Display!
    ");
        }
    
        $bgcolor = "#E0E0E0"; // light gray
    
     
        while($row = mysql_fetch_array($result)){
            if ($bgcolor == "#E0E0E0"){
                $bgcolor = "#FFFFFF";
            }else{
                $bgcolor = "#E0E0E0";
            }
    $usr = getnick_uid($row[uid]);
    echo "<a href=\"./files/$row[filename]\">$row[filename]</a> ($row[filesize]) Uploaded On: $row[date] And Posted By <a href=\"web/inbox.php?action=sendpm&amp;who=$row[uid]&amp;sid=$sid\">$usr</a> 
    ";
        }
    
         if($page != 1){ 
            $pageprev = $page-1;
            
            echo("<a href=\"index.php?page=$pageprev\">PREV ".$limit."</a> "); 
        }else{
            echo("PREV ".$limit." ");
        }
    
        $numofpages = $totalrows / $limit; 
        
        for($i = 1; $i <= $numofpages; $i++){
            if($i == $page){
                echo($i." ");
            }else{
                echo("<a href=\"index.php?page=$i\">$i</a> ");
            }
        }
    
        if(($totalrows % $limit) != 0){
            if($i == $page){
                echo($i." ");
            }else{
                echo("<a href=\"index.php?page=$i\">$i</a> ");
            }
        }
    
        if(($totalrows - ($limit * $page)) > 0){
            $pagenext = $page+1;
             
            echo("<a href=\"index.php?page=$pagenext\">NEXT ".$limit."</a>"); 
        }else{
            echo("NEXT ".$limit); 
        }
        
        mysql_free_result($result); 
    
        
        
    
    echo "
    Total Files Uploaded: [b]$countfile[/b]
    ";
    echo "Page(s) [b]$page[/b] of [b]$numofpages[/b]
    ";
    
    echo "<a href=\"upload.php?sid=$sid&amp;site=$site\">Upload Your Files Now!</a>
    ";
    echo "The Upload Page is an XHTML and may not work on All Phones
    ";
    echo "";
    
    echo "</p>";
    echo "
    
    ";
        if($site=="wap"){
        echo "
    
    <a href=\"../wap/index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
        echo "</p>";
    }else{
        echo "
    
    <a href=\"../web/index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
        echo "</p>";
    }
    if($site=="wap"){
    echo "</card>";
    echo "</wml>";
    }else{
        echo "</body>";
        echo "</html>";
    }
    
    ?>

    #2
    and file upload.php
    Code:
    <?php
    include("../web/core.php");
    include("../web/config.php");
    connectdb();
    $uip = getip();
    $action = $_GET["action"];
    $sid = $_GET["sid"];
    $page = $_GET["page"];
    $who = $_GET["who"];
    $uid = getuid_sid($sid);
    $sid = $_GET["sid"];
    $site = $_GET["site"];
    $theme = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE id=&#39;".$uid."&#39;"));
    $sitename = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name=&#39;sitename&#39;"));
    $sitename = $sitename[0];
    
    echo &#39;<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html"/>
    <meta http-equiv="Cache-Control" content="no-cache" forua="true"/>&#39;;
    echo "<title>$sitename Upload Files</title>";
    echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
    echo "</head>";
    echo "<body bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#0000FF\" vlink=\"#800080\">";
    
    if ($upload="upload"&&$superdat_name){
    
    if (!eregi("\.(mid|gif|bmp|mid|midi|3gp|mp3|wav|jar|jad|jpeg|jpg|sis|mmf|amr|png|wbmp)$",$superdat_name)){
    print "[b]Unsupported File Extention![/b]";
    }else{
    $superdat_name = preg_replace(
                 &#39;/[^a-zA-Z0-9\.\$\%\&#39;\`\-\@\{\}\~\!\#\(\)\&\_\^]/&#39;
                 ,&#39;&#39;,str_replace(array(&#39; &#39;,&#39;%20&#39;,"&#39;"),array(&#39;_&#39;,&#39;_&#39;, ""),$superdat_name));
    if(strlen($superdat_name)>53){ print "[b]File Name Is Too Long![/b]";
    }else{
    if (empty($superdat)) {
    print "[b]No input file specified!!![/b]";
    }else{
    copy("$superdat", "files/$superdat_name") or
    die("Couldn&#39;t copy file.");
    
    $date=(date("D, j F Y"));
    $fsize=round($superdat_size/1024,1);
    $text = "&&$superdat_name&&$fsize KB&&$date&&$REMOTE_ADDR&&";
    $fz = "$fsize KB";
    if("$text"!="$check[1]"){
    $mysql=mysql_query("INSERT INTO ibwf_uploads SET id=&#39;&#39;, uid=&#39;".$uid."&#39;, filename=&#39;".$superdat_name."&#39;, filesize=&#39;".$fsize." KB&#39;, date=&#39;".$date."&#39;, uip=&#39;".$REMOTE_ADDR."&#39;");
    echo mysql_error();
    }
    echo "[b]$superdat_name[/b] has successfully been uploaded to our uploader";
    }
    }
    }
    }
    ?>
    <?php
    echo "<FORM align=\"center\" ACTION=\"upload.php?sid=$sid&amp;site=$site\" METHOD=\"POST\" ENCTYPE=\"multipart/form-data\">";
    ?>
    [b]Select File To Be Uploaded :[/b]
    
    <input align="center" type="file" name="superdat">
    
    <input align="center" type="hidden" name="upload" value="upload"/>
    <INPUT align="center" TYPE=SUBMIT NAME="submit" VALUE="Upload File!">
    
    </small>
     [b][u]You can only upload files with folowing extentions:[/u][/b]
    
    .jpg, .jpeg, .gif, .png, .bmp, wbmp, .mid, .midi, .mpg, .mmf, .amr, .mp3, .wav, .wmv , .avi, .3gp, .sis, .jar, .jad, .zip, .rar, .txt
    
    ----------
    <?php echo "
    [size="1"]<a href=\"index.php?sid=$sid&amp;site=$site\">Uploaded Files</a>[/size]"; ?>
    </FORM>
    <?php
    
    if($site=="wap"){
        echo "
    
    <a href=\"../wap/index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
    }else{
        echo "
    
    <a href=\"../web/index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
    }
    ?>
    </body>
    </html>

    Comment


      #3
      have u chmooded the destination folder to 777?

      Comment


        #4
        it would also help to tell us the error your reciving so we can help

        Comment


          #5
          yes, folder 777
          http://universal3000.altervista.org/chat_u...aded/upload.php

          Comment


            #6
            copy and paste the error it give you wehn you upload

            Comment


              #7
              don&#39;t load the files, have put the link to make the test, but doesn&#39;t work!

              Comment


                #8
                Ok look in your upload folder ?
                Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
                Visit: WapMasterz Coming Back Soon!
                _______
                SCRIPTS FOR SALE BY SUBZERO
                Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
                FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
                _______
                Info & Tips
                php.net
                w3schools.com

                Comment


                  #9
                  in the briefcase files, doesn&#39;t have any loaded photo, I have only five fileses .htaccess

                  Comment


                    #10
                    cheak if php flag register global is turn off
                    sigpic

                    Comment


                      #11
                      yes, php flag register global is turn off, but don t work my upload

                      Comment


                        #12
                        <div class='quotetop'>QUOTE (Leviathan73 @ Feb 6 2009, 06:14 PM) <{POST_SNAPBACK}></div>
                        yes, php flag register global is turn off, but don t work my upload [/b]
                        turn it ON
                        sigpic

                        Comment


                          #13
                          all files are set, Register Globals ON Upload files with PHP 5 Active Support php5 (php4 = off) ON,
                          and does not work

                          Comment


                            #14
                            1) u have same folder which u set for uploaded file.
                            2) folder permission is read and write for all
                            3) php flag register gobal is on

                            grrrrrrrrrrrrrrrrrrrrrrrrrr then what the ****ing problem is !!
                            sigpic

                            Comment


                              #15
                              mate did you use a wapdesire script for that upload, check your ftp connection at core.php might it help and chmod 777 the folder where the upload goes...Thinking.

                              Comment

                              Working...
                              X