slight prob with this

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

    slight prob with this

    hi guys .
    i have editted a file that is used for mms which gets the file .i want it to use on my uploaders
    prob i have is some ppl mainly ppl with phones are only getting the main menu link and not the file that they clicked on . it works fine for me on all my browsers and even my ****ty old nokia phone lol .

    think its something to do with headers and i need a lil help fixing it.

    heres the code
    PHP Code:
    <?php
    include("../web/config.php");
    include(
    "../web/core.php");
    $conms mysql_connect($dbhost,$dbuser,$dbpass);
    $condb mysql_select_db($dbname);
    $file $_GET["file"];
    $sid $_GET["sid"];
    $file mysql_fetch_array(mysql_query("SELECT filename, uid from ibwf_mp3 WHERE id='".$file."'"));
        
    $uid mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_ses WHERE id='".$sid."'"));
            
    $uid $uid[0];
        if (
    $file[1] == $uid){
        
    header("Location: files/".$file[0]);
    }
        else{
            
    header("Content-type: text/html");
            echo 
    "<html><a href=\"index.php?action=main&amp;sid=$sid\">Main Menu</a></p></html>";
        }
    ?>
    cheers
    Last edited by nclemale36; 19.04.11, 20:34.
    Wapchat4u


    Topsites4u

    #2
    Use PHP code so text looks fine.

    try changing this
    PHP Code:
    header("Location: files/".$file[0]); 
    to this
    PHP Code:
    header("Location: ./files/".$file[0]); 
    Did I help you?
    You can help me too
    Your donations will help me finance my studies.

    Comment


      #3
      just the same with that .
      Wapchat4u


      Topsites4u

      Comment


        #4
        try using
        PHP Code:
        readfile('files/' $file[0]); 
        Did I help you?
        You can help me too
        Your donations will help me finance my studies.

        Comment


          #5
          that opens the file up as text .
          Wapchat4u


          Topsites4u

          Comment


            #6
            Change MIMETYPE to your File mime-type
            PHP Code:
            header('Content-Type: MIMETYPE');
            readfile('files/' $file[0]); 
            Did I help you?
            You can help me too
            Your donations will help me finance my studies.

            Comment


              #7
              cheers for the help but i just get errors with that.
              Wapchat4u


              Topsites4u

              Comment


                #8
                example:

                if you need GIF output
                PHP Code:
                header('Content-type: image/gif');
                readfile('files/' $file[0]); 
                if you need JPEG output
                PHP Code:
                header('Content-type: image/jpeg');
                readfile('files/' $file[0]); 
                if you need PNG output
                PHP Code:
                header('Content-type: image/png');
                readfile('files/' $file[0]); 
                if you need BMP output
                PHP Code:
                header('Content-type: image/bmp');
                readfile('files/' $file[0]); 
                Did I help you?
                You can help me too
                Your donations will help me finance my studies.

                Comment


                  #9
                  its letting you download the files because you uploaded them .... hence your id is $file[1]

                  change to something like:
                  PHP Code:
                  <?php
                  include("../web/config.php");
                  include(
                  "../web/core.php");
                  $conms mysql_connect($dbhost,$dbuser,$dbpass);
                  $condb mysql_select_db($dbname);
                  $file $_GET["file"];
                  $sid $_GET["sid"];
                  $file mysql_fetch_array(mysql_query("SELECT filename, uid from ibwf_mp3 WHERE id='".$file."'"));
                      
                  $uid mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_ses WHERE id='".$sid."'"));
                          
                  $uid $uid[0];
                      if (
                  $file[0] != ''){
                      
                  header("Location: files/".$file[0]);
                  }
                      else{
                          
                  header("Location: index.php?action=main&amp;sid=$sid");
                      }
                  ?>

                  Comment


                    #10
                    omg your right. i never tested anyone elses uploaded files. its giving me a pop up now asking if i want to save getfile.php . i will try above and get back to u

                    Added after 14 minutes:

                    thanks something_else seems to be working for one of my users that it wasnt working for before . .
                    Last edited by nclemale36; 19.04.11, 22:55.
                    Wapchat4u


                    Topsites4u

                    Comment

                    Working...
                    X