MMS getfile

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    MMS getfile

    hi there iam with some problems with the getfile.php
    When i upload the file it goes to the pre configured folder
    but it doesnt show it and a cant download it someone could help me?

    heres the script
    PHP Code:
    <?
    ////////////////DB Details/////////////////
    $dbname = "....";                     //change to your mysql database name
    $dbhost = "localhost";                              //database host name
    $dbuser = "....";                        //database user name
    $dbpass = "....";        
    //////////////////////////////////////////
    $conms = mysql_connect($dbhost,$dbuser,$dbpass);
    $condb = mysql_select_db($dbname);


    session_start();
    $_SESSION['sid']=$sid;
    $fileid = $_GET["fileid"];
        $file = mysql_fetch_array(mysql_query("SELECT filename, touid FROM mms WHERE id=$fileid"));
        $uid = mysql_fetch_array(mysql_query("SELECT uid FROM fun_ses WHERE id='".$sid."'"));
            $uid = $uid[0];

        if ($file[1] == $uid){
        header("Location: mmsloads/".$file[0]);
        }
        else{
            header("Content-type: text/html");
            echo "<html><p>This file is not yours!<br/><a href=\"index.php?action=main\">Main Menu</a></p></html>";
        }
    ?>

    #2
    are you sure there are the dbname, dbuser and dbpass correct?
    mysterio.al - programming is a functional art

    Comment


      #3
      chm0od the folder mmsloads

      Comment


        #4
        Originally posted by WereWolveZ View Post
        chm0od the folder mmsloads
        the file is being uploaded. Why chmod?
        mysterio.al - programming is a functional art

        Comment


          #5
          easy to fix go to ur config.php and add $mmsdir = "./mmsloads";

          Comment


            #6
            in the config it already is there that riderz and it doesnt work

            Comment


              #7
              Not Acceptable

              An appropriate representation of the requested resource /getfile.php could not be found on this server.

              Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
              This is the error

              Comment


                #8
                It's a simpel error.... Look again in your files..... I think you might have mis typed a command or deleted a syntax....
                BakGat
                Code:
                class Counter {
                public:
                  void Count();
                  int  ReadDisplay();
                private:
                  int  CurrentCount;
                };








                Back up my hard drive? How do I put it in reverse?
                My Community
                BakGat
                sigpic

                Comment


                  #9
                  ive modified the gefile to this
                  PHP Code:
                  <?
                  include("config.php");
                  include("core.php");
                  $bcon = connectdb();
                  if (!$bcon)
                  {
                      
                    echo "<p align=\"center\">";
                      echo "<img src=\"images/exit.gif\" alt=\"*\"/><br/>";
                      echo "ERRO! banco de dados em manutencao<br/><br/>";
                      echo "Aguarde alguns instantes e tente novamente!<br/><br/>";
                      
                       
                      echo "</p>";
                      exit();
                  }

                  session_start();
                  $_SESSION['sid']=$sid;
                  $fileid = $_GET["fileid"];
                      $file = mysql_fetch_array(mysql_query("SELECT filename, touid FROM mms WHERE id=$fileid"));
                      $uid = mysql_fetch_array(mysql_query("SELECT uid FROM fun_ses WHERE id='".$sid."'"));
                          $uid = $uid[0];

                      if ($file[1] == $uid){
                      header("Location: mmsloads/".$file[0]);
                      }
                      else{
                          header("Content-type: text/html");
                          echo "<html><p>This file is not yours!<br/><a href=\"index.php?action=main\">Main Menu</a></p></html>";
                      }
                  and still not working
                  it uploads and it adds it to the database but not showing the file

                  Comment


                    #10
                    If i'am not mistaken I think mmsuploads uses cron job to get it working.... But I could be wrong... I'll check and I'll let you know I have the full working snippet.
                    BakGat
                    Code:
                    class Counter {
                    public:
                      void Count();
                      int  ReadDisplay();
                    private:
                      int  CurrentCount;
                    };








                    Back up my hard drive? How do I put it in reverse?
                    My Community
                    BakGat
                    sigpic

                    Comment


                      #11
                      it doesnt use cron job if u check my post for mms ull find the complete code for it use it as it is then ull have no prob

                      Comment


                        #12

                        Comment


                          #13
                          i found a way to make it work withou the getfile
                          PHP Code:
                          else if($action=="readmms"){

                          $pminfo mysql_fetch_array(mysql_query("SELECT pmtext, byuid, timesent,touid, reported, filename, size, extension, origname FROM mms WHERE id='".$pmid."'"));
                           
                          addonline(getuid_sid($sid),"Vendo <i>".getnick_uid($pminfo[1])."</i>\ MMS","");
                          if(
                          getuid_sid($sid)==$pminfo[3]){
                          $chread mysql_query("UPDATE mms SET unread='0' WHERE id='".$pmid."'");
                          }


                          if((
                          $pminfo[3]==getuid_sid($sid))||($pminfo[1]==getuid_sid($sid))){
                          if(
                          getuid_sid($sid)==$pminfo[3]){
                          if(
                          isonline($pminfo[1])){
                          $iml "<img src=\"http://coding-talk.com/images/onl.gif\" alt=\"O\"/>";
                          }else{
                          $iml "<img src=\"http://coding-talk.com/images/ofl.gif\" alt=\"O\"/>";
                          }
                          $ptxt "<b>De</b>: ";
                          $bylnk "$iml<a href=\"index.php?action=viewuser&amp;who=$pminfo[1]\">".getnick_uid($pminfo[1])."</a>";
                          }else{
                          if(
                          isonline($pminfo[3])){
                          $iml "<img src=\"http://coding-talk.com/images/onl.gif\" alt=\"O\"/>";
                          }else{
                          $iml "<img src=\"http://coding-talk.com/images/ofl.gif\" alt=\"O\"/>";
                          }
                          $ptxt "<b>Para</b>: ";
                          $bylnk "$iml<a href=\"index.php?action=viewuser&amp;who=$pminfo[3]\">".getnick_uid($pminfo[3])."</a>";
                          }
                          echo 
                          "$ptxt $bylnk<br/>";
                          $tmstamp $pminfo[2] + addhours();
                          $tmdt date("d/m/Y h:i:s A"$tmstamp);
                          $diff1=time()-$pminfo[2];
                          echo 
                          "<b>Enviada a </b>: $tmdt<br/>".gettimemsg($diff1)." atras<br/>";
                          $pmtext parsepm($pminfo[0], $sid);

                          if(
                          isspam($pmtext)){
                          if((
                          $pminfo[4]=="0") && ($pminfo[1]!=1)){
                          mysql_query("UPDATE fun_private SET reported='1' WHERE id='".$pmid."'");
                          }
                          }
                          switch(
                          strtolower($pminfo[7])){
                                  case 
                          "mid":
                                  
                          $ext "MIDI tone";
                                  break;
                                  case 
                          "3gp":
                                  
                          $ext "3GP Video";
                                  break;
                                  case 
                          "amr":
                                  
                          $ext "AMR Audio/Recorded Voice";
                                  break;
                                  case 
                          "wav":
                                  
                          $ext "WAV Audio";
                                  break;
                                  case 
                          "mp3":
                                  
                          $ext "MP3 Audio";
                                  break;
                                  case 
                          "jpg":
                                  
                          $ext "JPG Image";
                                  break;
                                  case 
                          "gif":
                                  
                          $ext "GIF Image";
                                  break;
                                  case 
                          "png":
                                  
                          $ext "PNG Image";
                                  break;
                                  case 
                          "bmp":
                                  
                          $ext "BMP Image";
                                  break;
                                  case 
                          "exe":
                                  
                          $ext "Windows Executable file";
                                  break;
                                  case 
                          "zip":
                                  
                          $ext "Compressed ZIP Archive";
                                  break;
                                  case 
                          "rar":
                                  
                          $ext "Compressed RAR Archive";
                                  break;
                                  case 
                          "sis":
                                  
                          $ext "Symbian Application";
                                  break;
                                  case 
                          "jar":
                                  
                          $ext "Java Mobile Application";
                                  break;

                          }
                          $file mysql_fetch_array(mysql_query("SELECT filename, touid FROM mms WHERE id='".$fileid."'"));

                          echo 
                          "<b>Mensagem</b>:<br/>".$pmtext."</br>";
                          if (
                          $pminfo[7]=="gif"){
                                  echo 
                          "<br/>Image:<br/><img src=\"mmsloads/$pminfo[5]\" alt=\"Loading...\"/><br/>";
                          }
                          if (
                          $pminfo[7]=="jpg"){
                                  echo 
                          "<br/>Image:<br/><img src=\"mmsloads/$pminfo[5]\" alt=\"Loading...\"/><br/>";
                          }
                          if (
                          $pminfo[7]=="bmp"){
                                  echo 
                          "<br/>Image:<br/><img src=\"mmsloads/$pminfo[5]\" alt=\"Loading...\"/><br/>";
                          }
                          if (
                          $pminfo[7]=="png"){
                                  echo 
                          "<br/>Image:<br/><img src=\"mmsloads/$pminfo[5]\" alt=\"Loading...\"/><br/>";
                          }
                          if (
                          $pminfo[7]=="mid"){
                                  echo 
                          "<bgsound src=\"mmsloads/$pminfo[5]\" loop=\"infinite\"/>";
                          }
                          if ((
                          $pminfo[7]=="amr") && ($pminfo[6]<100)){
                                  echo 
                          "<bgsound src=\"mmsloads/$pminfo[5]\" loop=\"infinite\"/>";
                          }
                          if ((
                          $pminfo[7]=="mp3") && ($pminfo[6]<100)){
                                  echo 
                          "<bgsound src=\"mmsloads/$pminfo[5]\" loop=\"infinite\"/>";
                          }
                          if ((
                          $pminfo[7]=="wav") && ($pminfo[6]<100)){
                                  echo 
                          "<bgsound src=\"mmsloads/$pminfo[5]\" loop=\"infinite\"/>";
                          }
                          echo 
                          "<br/><b>Ficheiro</b>:<br/>".$pminfo[8];
                          echo 
                          "<br/><b>Tipo de Ficheiro</b>:<br/>".$ext;
                          echo 
                          "<br/><a href=\"mmsloads/$pminfo[5]\">Download</a><br/>";
                          echo 
                          "<a href=\"inbox.php?action=sendmms&amp;who=$pminfo[1]\">Responder</a><br/><a href=\"inbox.php?action=sendpm&amp;who=$pminfo[1]\">Responder por pm normal</a>";
                          echo 
                          "<p>";
                          echo 
                          "<b>Acao</b>: <form action=\"inbxproc.php?action=mproc\" method=\"post\"><select id=\"inputText\" name=\"pmact\">";

                          echo 
                          "<option value=\"del-$pmid\">Deletar</option>";
                          if(
                          isstarred($pmid)){
                          echo 
                          "<option value=\"ust-$pmid\">Nao Guardar</option>";

                          }else{
                          echo 
                          "<option value=\"str-$pmid\">Guardar</option>";
                          }

                          echo 
                          "<option value=\"rpt-$pmid\">Reportar</option>";

                          echo 
                          "</select>";
                          echo 
                          "<br/><input id=\"inputButton\" type=\"submit\" value=\"ir\"/>";
                          echo 
                          "</form>";
                          }else{
                          echo 
                          "This PM ain't yours";
                          }
                          echo 
                          "<br/><a href=\"inbox.php?action=mmsdisp\">Voltar</a></br>";
                          echo 
                          "<center><a href=\"index.php?action=main\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
                          echo 
                          "Pagina inicial</a></center>";
                            echo 
                          "</p>";

                          insted of:
                          getfile.php?fileid=$fileid
                          i used the
                          mmsloads/$pminfo[5] the $pminfo its already declared so i took the values from the db from there :D
                          Last edited by ObscureMind; 01.01.10, 21:01.

                          Comment

                          Working...
                          X