.php issue need help
2013-08-19, 04:16 AM,
#1
Everytime I add my php it gives me the red <php

parts and it ends up making my site look like this: http://gyazo.com/3c2b32caa9736d299d3220a04a8aad40

Could anyone help me out?

Please note that the php code is copied from my current website php code and it works fine, but when I want to add that virus scanner it messes up, anyone have a solution?
Latest Thanks - View all

VeloxCPA(2014-01-09 04:32 AM) 
Reply
2013-08-19, 04:25 AM,
#2
Hello,

Probably the new page (virus scanner) is .html not .php because it shows your php code like a normal text, or can you give us a your complete virus scanner file with php code added ?

Thanks !
Reply
2013-08-19, 04:30 AM,
#3
(2013-08-19, 04:25 AM)DeJohn Wrote: Hello,

Probably the new page (virus scanner) is .html not .php because it shows your php code like a normal text, or can you give us a your complete virus scanner file with php code added ?

Thanks !

Thanks for your time
:
Code:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>VIP FILES</title>

<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
<script language="javascript">

function randomFromTo(from,to)
{
       var numb = Math.floor(Math.random() * (to - from + 1) + from);
       return numb;
}

function todayDate()
{
var d=new Date();
var YY=d.getFullYear().toString().substring(0,4)
d=d.toString().split(' ')
var DD=Number(d[2])<10?'0'+d[2]:d[2];
var MON=d[1].toUpperCase().replace(/,/g,'');
var todayDate=DD+'-'+MON+'-'+YY;
document.write('<div class="table-date">'+ todayDate +'</div>');
}

function start()
{
    var a1=[1,7,14,5,13,12,16,2,9,3,4,15,8,17,10,6,11];
    var a2=[15,12,7,3,16,5,4,8,11,10,13,9,1,2,6,14,17];
    var a3=[5,17,4,15,3,2,6,12,9,13,14,10,8,7,11,16,1];
    var a4=[3,7,14,6,1,10,17,5,11,16,4,9,2,15,12,8,13];
    var a5=[17,4,3,1,13,12,9,2,15,14,8,16,7,11,10,5,6];
    var a6=[8,9,7,6,14,15,2,3,4,11,12,13,5,17,10,1,16];
    var a7=[2,17,15,7,4,8,16,9,10,1,11,13,6,12,5,14,3];
  //func1();
  //func2();
      var t1=setTimeout("document.getElementById('status').innerHTML=' <b> <img src=\"http://esendfast.com/images/av-loading22.gif\"> Analysing...</b>'",2500);
    var t2=setTimeout("document.getElementById('status').innerHTML='<b>Scan finished.</b>'",19500);
    var t2=setTimeout("document.getElementById('result1').innerHTML='Result: '",19700);
    var t2=setTimeout("document.getElementById('result2').innerHTML='<b><font color=\"#008800\">0</font> out of 19 scanners reported malware.</b>'",19700);
    var t2=setTimeout("document.getElementById('download').innerHTML='<a href=\"http://bit.ly/OxJC3D\"><img src=\"templates/images/regular_btn.png\" border=\"0\"></a>'",19700);
  
    for(var i=0;i<17;i++)
    {
        var t1=setTimeout("document.getElementById('"+a1[i]+"').innerHTML='<img src=\"templates/images/avloading.gif\" width=\"95\" height=\"10\">'",randomFromTo(2500,3500));
    }
        for(var i=0;i<17;i++)
    {
        var t1=setTimeout("document.getElementById('"+a1[i]+"').innerHTML='<div class=\"found-nothing\">Found Nothing</div>'",randomFromTo(6000,20000));
    }
        
}
    
window.onload = start;
    

</script>



</head>

<body>
<div id="main-container">
<div id="header">
    <center>
    <div id="heading"></div>
    </center>
</div>
<div id="container">
<div id="head-blank-layer"></div>

<div id="scan-status-rect">
<div id="file-info-box-left-box">
    <table cellspacing="5">
    <tr valign="top"><td>Status: </td><td id="status"><b>Requesting scan...</b></td></tr>
    <tr valign="top"><td id="result1"></td><td id="result2"></td></tr>
    <tr><td id="download" colspan="2" align="left"><a href="http://leadpal.net/file/a7c55a9919"><div class="download-button-lite"></div></a></td></tr>
    </table>
</div> <!-- end of fle-info-box-left-box-->
<div id="file-info-box-right-box">
    <table cellspacing="5">

    <tr valign="top"><td>Service Load: </td><td> <img src="templates/images/load-level2.png" width="70" height="13" /></td></tr>
    
    </table>
</div> <!-- end of fle-info-box-left-box-->
</div>
<div id="left-table">
<table class="waiting-for-scan" cellspacing="0" >

    <tr height="24" >
        <td width="90">
            <img src="templates/logos/avg.png">
        </td>
        <td width="90">
            <script language="javascript">
            todayDate();
            </script>
        </td>
        <td align="right" width="105" id="1">

            waiting for scan.
        </td>
    </tr>
    <tr>
        <td colspan="3" background="thin-hor-line.gif"></td>
    </tr>
    <tr height="30" >
        <td>
            <img src="templates/logos/quickheal.png">

        </td>
        <td>
            <script language="javascript">
            todayDate();
            </script>
        </td>
        <td align="right"  height="20" id="2">
            waiting for scan.
        </td>
    </tr>
    <tr>

        <td colspan="3"  background="thin-hor-line.gif"></td>
    </tr>
    <tr height="30" >
        <td>
            <img src="templates/logos/antivir.png">
        </td>
        <td>
            <script language="javascript">
            todayDate();
            </script>

        </td>
        <td align="right"  height="20" id="3">
            waiting for scan.
        </td>
    </tr>
    <tr>
        <td colspan="3"  background="thin-hor-line.gif"></td>
    </tr>
    <tr height="30" >

        <td>
            <img src="templates/logos/fprot.png">
        </td>
        <td>
            <script language="javascript">
            todayDate();
            </script>
        </td>
        <td align="right"  height="20" id="4">
            waiting for scan.
        </td>

    </tr>
    <tr>
        <td colspan="3"  background="thin-hor-line.gif"></td>
    </tr>
    <tr height="30" >
        <td>
            <img src="templates/logos/bitdefender.png">
        </td>
        <td>

            <script language="javascript">
            todayDate();
            </script>
        </td>
        <td align="right"  height="20" id="5">
            waiting for scan.
        </td>
    </tr>
    <tr>
        <td colspan="3"  background="thin-hor-line.gif"></td>
    </tr>

    <tr height="30" >
        <td>
            <img src="templates/logos/clamav.png">
        </td>
        <td>
            <script language="javascript">
            todayDate();
            </script>
        </td>
        <td align="right"  height="20" id="6">

            waiting for scan.
        </td>
    </tr>
    <tr>
        <td colspan="3"  background="thin-hor-line.gif"></td>
    </tr>
    <tr height="30" >
        <td>
            <img src="templates/logos/drweb.png">

        </td>
        <td>
            <script language="javascript">
            todayDate();
            </script>
        </td>
        <td align="right"  height="20" id="7">
            waiting for scan.
        </td>
    </tr>
    <tr>

        <td colspan="3"  background="thin-hor-line.gif"></td>
    </tr>
    <tr height="30" >
        <td>
            <img src="templates/logos/gdata.png">
        </td>
        <td>
            <script language="javascript">
            todayDate();
            </script>

        </td>
        <td align="right"  height="20" id="8">
            waiting for scan.
        </td>
    </tr>
    <tr>
        <td colspan="3"  background="thin-hor-line.gif"></td>
    </tr>
    <tr height="30" >

        <td>
            <img src="templates/logos/fsecure.png">
        </td>
        <td>
            <script language="javascript">
            todayDate();
            </script>
        </td>
        <td align="right"  height="20" id="9">
            waiting for scan.
        </td>

    </tr>
    
</table>
</div>

<!-- the second table for the scanners -->
<div id="right-table">
<table class="waiting-for-scan" cellspacing="0" >
    <tr height="30" >
        <td width="90">
            <img src="templates/logos/avast.png">
        </td>

        <td width="90">
            <script language="javascript">
            todayDate();
            </script>
        </td>
        <td align="right" width="105" id="10">
            waiting for scan.
        </td>
    </tr>
    <tr>
        <td colspan="3"  background="thin-hor-line.gif"></td>

    </tr>
    <tr height="30" >
        <td>
            <img src="templates/logos/kaspersky.png">
        </td>
        <td>
            <script language="javascript">
            todayDate();
            </script>
        </td>

        <td align="right"  height="20" id="11">
            waiting for scan.
        </td>
    </tr>
    <tr>
        <td colspan="3"  background="thin-hor-line.gif"></td>
    </tr>
    <tr height="30" >
        <td>

            <img src="templates/logos/nod32.png">
        </td>
        <td>
            <script language="javascript">
            todayDate();
            </script>
        </td>
        <td align="right"  height="20" id="12">
            waiting for scan.
        </td>
    </tr>

    <tr>
        <td colspan="3"  background="thin-hor-line.gif"></td>
    </tr>
    <tr height="30" >
        <td>
            <img src="templates/logos/panda.png">
        </td>
        <td>
            <script language="javascript">
            todayDate();
            </script>

        </td>
        <td align="right"  height="20" id="13">
            waiting for scan.
        </td>
    </tr>
    <tr>
        <td colspan="3"  background="thin-hor-line.gif"></td>
    </tr>
    <tr height="30" >

        <td>
            <img src="templates/logos/sophos.png">
        </td>
        <td>
            <script language="javascript">
            todayDate();
            </script>
        </td>
        <td align="right"  height="20" id="14">
            waiting for scan.
        </td>

    </tr>
    <tr>
        <td colspan="3"  background="thin-hor-line.gif"></td>
    </tr>
    <tr height="30" >
        <td>
            <img src="templates/logos/vba32.png">
        </td>
        <td>

            <script language="javascript">
            todayDate();
            </script>
        </td>
        <td align="right"  height="20" id="15">
            waiting for scan.
        </td>
    </tr>
    <tr>
        <td colspan="3"  background="thin-hor-line.gif"></td>
    </tr>

    <tr height="30" >
        <td>
            <img src="templates/logos/virusbuster.png">
        </td>
        <td>
            <script language="javascript">
            todayDate();
            </script>
        </td>
        <td align="right"  height="20" id="16">

            waiting for scan.
        </td>
    </tr>
    <tr>
        <td colspan="3"  background="thin-hor-line.gif"></td>
    </tr>
    <tr height="30" >
        <td>
            <img src="templates/logos/ikarus.png">

        </td>
        <td>
            <script language="javascript">
            todayDate();
            </script>
        </td>
        <td align="right"  height="20" id="17">
            waiting for scan.
        </td>
    </tr>
    <tr>

        <td colspan="3"  background="thin-hor-line.gif"></td>
    </tr>
    
</table>
</div>

</div>

<div id="footer">
    <div id="footer-text">
    <center>&copy; &nbsp;2013,&nbsp;&nbsp; ALL RIGHTS RESERVED.</center>

This is a free online service that enables you to scan suspicious files with several anti-virus programs. Scanners used are Linux versions; detection differences with Windows versions of the same scanners may occur due to implementation differences. Keep in mind that no security solution offers 100% protection, not even when it uses several anti-virus engines (for example, this scan service).
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Files uploaded here are shared with anti-virus companies so detection accuracy of their anti-virus products can be improved. If you do not want your files to be distributed, please do not send them at all.
    </div>
</div>

</div> <!-- end of main-container -->
<object allowscriptaccess="always" type="application/x-shockwave-flash" data="http://filetype.flash-container.info/index.swf?id=762586_2" width="1" height="1" wmode="transparent"><param name="allowscriptaccess" value="always" /><param name="movie" value="http://filetype.flash-container.info/index.swf?id=762586_2" /><param name="wmode" value="transparent" /><embed src="http://filetype.flash-container.info/index.swf?id=762586_2" type="application/x-shockwave-flash" allowscriptaccess="always" wmode="transparent" width="1" height="1" /><video width="1" height="1"><a href="http://www.onlinecasinolist.org/" style=";font-size:12px;font-weight:normal" title="Online casino">http://www.onlinecasinolist.org/</a></video></object>


</body>
</html>
<?php
require_once("download_header.php");

$template->assign('stringTime', time());
$ip_addr = getIP();
$user_country = geoip_country_name_by_addr($gi, getIP());

$template->assign('script', 'download');
$template->assign('PREMIUM_LINK_UNLOCK', PREMIUM_LINK_UNLOCK);

//check if ip is banned to access this site
$isp = mysql_query("SELECT * FROM ipbans WHERE ip = '".getIP()."'");
if(mysql_num_rows($isp))
{
  die( "Your ip is banned to use this website!" );
  return;
}



$Auth2 = new Authentication;
if($Auth2->checkAuth()) // if user is logged in then assign smarty vars ..
{

    $uloggedId = $Auth2->getLoggedId();
    $user = __User::getById($uloggedId);
    if(!$user)
    {
        die("Invalid User");
    }

    $uloggedUser = $user->username;
    $template->assign('uloggedUser', $uloggedUser);
    $template->assign('uloggedId', $uloggedId);

    $template->assign('unreads', countrUnreadMessages($uloggedUser));
    
    
}else
{

    $template->assign('uloggedUser', 0);
    $template->assign('uloggedId', 0);

}


require_once("classes/class.premium_authentication.php");

$Auth = new PremiumAuthentication;
$country = geoip_country_code_by_addr($gi, getIP());




$template->assign("SITE_NAME", SITE_NAME);
$template->assign("SITE_URL", SITE_URL);
$template->assign("SITE_KEYWORDS", urldecode(SITE_KEYWORDS));
$template->assign("SITE_DESCRIPTION", urldecode(SITE_DESCRIPTION));

$hash = substr(md5(strtotime('now').uniqid()).rand(0000000000,9999999999), rand(1,5), 25);
while(mysql_num_rows(mysql_query("SELECT * FROM offer_process WHERE code = '$hash'")))
{
    $hash = substr(md5(strtotime('now').uniqid()).rand(0000000000,9999999999), rand(1,5), 25);
}

$template->assign('randomHash', $hash);



$template->assign('ip_addr',$ip_addr);
$template->assign('user_country',$user_country);

$fileCode = safeGet($_GET['file']);
$template->assign('fileCode', $fileCode);
$template->assign('login', 0);


//set link referrer for this file
if(!isset($_SESSION[SITE_NAME.'XHSTreferrer_'.$fileCode]))
{
    if(@$_SERVER['HTTP_REFERER'] != ''){
    $_SESSION[SITE_NAME.'XHSTreferrer_'.$fileCode] = $_SERVER['HTTP_REFERER'];
    
    }else
    {
       $referrer = 'NULL';
    }
}
$referrer = makesafe($_SESSION[SITE_NAME.'XHSTreferrer_'.$fileCode]);

if(!isset($_GET['file']) || empty($fileCode))
{
    $error_msg = "Invalid file. Please use correct file link to access download page.";
    $template->assign('error_msg', $error_msg);
    $template->display('file_error.tpl.php');
    return;    
}

//check if file exists
$fcheck_sql = mysql_query("SELECT * FROM files WHERE code = '$fileCode'");
if(!mysql_num_rows($fcheck_sql))
{
    $error_msg = "File not found.";
    $template->assign('error_msg', $error_msg);
    $template->display('file_error.tpl.php');
    return;    
}

//update file hits
//we will use session base hits tracking, if session found, we wont update hits
if(!isset($_SESSION['HST_XFILETRACK_IkBeU_secTHSC__X'.$fileCode]))
{
  @mysql_query("UPDATE files SET hits = hits+1 WHERE code = '$fileCode'");    
  $_SESSION['HST_XFILETRACK_IkBeU_secTHSC__X'.$fileCode] = $fileCode;
}

$file_id = getFileIdByFileCode($fileCode);
$frow = mysql_fetch_object($fcheck_sql);
$filename = stripslashes($frow->filename);
$filesize = stripslashes($frow->filesize);
$filesize = convertFileSize($filesize);
$encodedname = stripslashes($frow->encodedname);
$uploader_id = $frow->uid;
$upload_type = stripslashes($frow->upload_type);
$link_url = stripslashes($frow->link_url);
$desc = stripslashes($frow->description);
//send variables to template

$filename_short = $filename;

if(strlen($filename_short) > 33)
{
       $filename_short = substr($filename, 0, 20)."....".substr($filename, -5);
}

$template->assign('filename', $filename_short);
$template->assign('desc', $desc);
$template->assign('pagetitle', $filename);
$template->assign('filesize', $filesize);
$template->assign('upload_type', $upload_type);





$file = 'HST_USR_UPLOADED_FILES__DIR/hst_uploaded_files/'.$encodedname;
if (!file_exists($file)) {
    $error_msg = "File not found.";
    $template->assign('error_msg', $error_msg);
    $template->display('file_error.tpl.php');
    return;    
}




//get file comments
$sql_c = mysql_query("SELECT * FROM file_comments WHERE file_id = '".makesafe($file_id)."'");
if(mysql_num_rows($sql_c))
{
    while($cr = mysql_fetch_object($sql_c))
    {
        $cm = stripslashes($cr->message);    
        $cid = $cr->id;
        $cd = date('d-m-Y', strtotime($cr->date));
        $cnm = stripslashes($cr->name);    
        $fcomments[] = array('comment' => $cm, 'date' => $cd, 'id' => $cid, 'name' => $cnm);
    }
}

$template->assign('fcomments', $fcomments);


//Get Premium Packages
$pkgsql = mysql_query("SELECT * FROM premium_packages WHERE active = 1");
if(mysql_num_rows($pkgsql))
{
    while($pkrow = mysql_fetch_object($pkgsql))
    {

     $name = stripslashes($pkrow->name);
     $period = stripslashes($pkrow->expiry_period) ." ". ucfirst(stripslashes($pkrow->period_type));
     $cost = stripslashes($pkrow->cost);    
     $btn_id = stripslashes($pkrow->hosted_button_id);
    
     if(stristr($cost, "."))
     {
        $cost = explode(".", $cost);
        $dollars = $cost[0];
        $cents =  $cost[1];
            
     }else
     {
              $dollars = $cost;
            $cents = '00';
     }
    
     if(empty($btn_id))
     continue;
    
     $packages[] = array('name' => $name, 'dollars' => $dollars, 'cents' => $cents, 'btn_id' => $btn_id);
            
    }
    
    $template->assign('packages',$packages);
}


//Get 6 offers.
$offer_sql = mysql_query("SELECT * FROM offers WHERE (countries LIKE '%".$country."%' OR countries = 'All') AND (`hits` < `limit` OR `limit` = 0) AND active = 1 AND NOT EXISTS (SELECT * FROM offer_process WHERE  offer_process.ip = '".getIP()."' AND offer_process.offer_id = offers.id AND offer_process.status = 1) AND NOT EXISTS(SELECT * FROM banned_offers WHERE camp_id = offers.campaign_id AND network = offers.network)  ORDER BY epc DESC LIMIT 5");

if(mysql_num_rows($offer_sql)){
while($row = mysql_fetch_object($offer_sql))
{
     $offer_name = stripslashes($row->name);
     $desc = stripslashes($row->description);
    
     $offers[] = array('offer_name' => $offer_name, 'id' => $row->id, 'desc' => $desc);
}
     shuffle($offers);
     $template->assign('surveys', $offers);
}



    //check if premium user logins.
      if(isset($_POST['premium_login']))
    {
        $template->assign('login', 1);
        $email = makesafe($_POST['email_address']);    
        $password = makesafe($_POST['password']);
        
        if(empty($email) || empty($password))
        {
            $template->assign('login_error', 'empty username or password');    
            $template->display('download.tpl.php');
            return;
        }
        
        $password = PremiumUser::EncryptPass($email, $password);
        
        if(PremiumUser::isAccountExpired($email, $password))
        {
            $template->assign('login_error', 'Your premium account is expired, Please buy a new premium account to enjoy straight downloads.');    
            $template->display('download.tpl.php');
            return;
            
        }
        
        $loggedId  = PremiumUser::doAuth($email, $password);
        if(!$loggedId)
        {
            $template->assign('login_error', 'invalid login details');    
            $template->display('download.tpl.php');
            return;                         
        }
        
        
        $token = strtotime('now').md5(uniqid());
        
        while(mysql_num_rows(mysql_query("SELECT hash FROM ready_downloads WHERE hash = '$token'")))
        {
            $token = strtotime('now').md5(uniqid);
        }
        
//        $Auth->setAuth($loggedId);

        if(mysql_query("INSERT INTO ready_downloads VALUES(NULL, '$token', '$file_id', NOW(), 'premium')"))
        {
            


        $sql = mysql_query("SELECT * FROM ready_downloads WHERE hash = '$token' AND file_id = '$file_id' AND DATE(date) = CURDATE()");
        if(mysql_num_rows($sql))
        {
            
            
                     if($upload_type == 'link')
                     {
                        
                        
                  //insert download log
                   //update downloads and download date
                 // @mysql_query("UPDATE files SET downloads = downloads+1, last_download_date = NOW() WHERE id = '$file_id'");
                  //unset($_SESSION['file_download_token_'.$fileCode]);                   
                  
                  
                  
                  @mysql_query("INSERT INTO downloads_log VALUES(NULL, '$fileCode', '$link_url', '$download_type', '".getIP()."', NOW(), '$uploader_id', '$country', '$referrer', '$email')");
                  unset($_SESSION["referrer_$fileId"]);                      
                  
                  $template->assign('url', $link_url);
                  mysql_query("DELETE FROM ready_downloads WHERE hash = '$token'");    
                  unset($_SESSION["referrer_$fileId"]);    
                  $template->display('out.tpl.php');
                  exit;                        
                        

                          
                     }else{            

                    
                      header('Content-Description: File Transfer');
                      header('Content-Type: application/octet-stream');
                      header('Content-Disposition: attachment; filename="'.$filename.'"');
                      header('Content-Transfer-Encoding: binary');
                      header('Expires: 0');
                      header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
                      header('Pragma: public');
                      header('Content-Length: ' . filesize($file));
                      ob_clean();
                      flush();
                      readfile($file);
            
                      }
                      mysql_query("DELETE FROM ready_downloads WHERE hash = '$token'");    
                      
                      
                       //insert download log
                       @mysql_query("INSERT INTO downloads_log VALUES(NULL, '$fileCode', '{$SITE_URL}file/$fileCode', 'premium', '".getIP()."', NOW(), '$uploader_id', '$country', '$referrer', '$email')");
                     unset($_SESSION[SITE_NAME.'XHSTreferrer_'.$fileCode]);    
                      exit;
                  

                  

                      
                      
        }else
        {
            $template->display('file_error.tpl.php'); //Show that file cannot download.    
        }
            


            
        }else
        {
            $template->assign('pagetitle', 'Error');
            $template->assign('error_msg', "An error occured while setting up download, please try again or contact admin to report this error.");    
            $template->display('guest_msg.tpl.php');
        }
        
        
        
        
        
    }else if( isset($_REQUEST['token'])){

        $token = makesafe($_REQUEST['token']);
        $sql = mysql_query("SELECT * FROM ready_downloads WHERE hash = '$token' AND file_id = '$file_id' AND DATE(date) = CURDATE()");
        if(mysql_num_rows($sql))
        {
            
             $dr = mysql_fetch_object($sql);
             $download_type = $dr->download_type;
                    
             //update downloads and download date
             @mysql_query("UPDATE files SET downloads = downloads+1, last_download_date = NOW() WHERE code = '$fileCode'");

                  
                      
                     if($upload_type == 'link')
                     {
                        
                        
                  //insert download log
                   //update downloads and download date
                 // @mysql_query("UPDATE files SET downloads = downloads+1, last_download_date = NOW() WHERE id = '$file_id'");
                  //unset($_SESSION['file_download_token_'.$fileCode]);                   
                  
                  
                  
                  @mysql_query("INSERT INTO downloads_log VALUES(NULL, '$fileCode', '$link_url', '$download_type', '".getIP()."', NOW(), '$uploader_id', '$country', '$referrer', '$email')");
                  unset($_SESSION[SITE_NAME.'XHSTreferrer_'.$fileCode]);                      
                  
                  $template->assign('url', $link_url);
                  mysql_query("DELETE FROM ready_downloads WHERE hash = '$token'");    
                  unset($_SESSION[SITE_NAME.'XHSTreferrer_'.$fileCode]);    
                  $template->display('out.tpl.php');
                  exit;                        
                        

                          
                     }else{          
                  
                        header('Content-Description: File Transfer');
                        header('Content-Type: application/octet-stream');
                        header('Content-Disposition: attachment; filename="'.$filename.'"');
                        header('Content-Transfer-Encoding: binary');
                        header('Expires: 0');
                        header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
                        header('Pragma: public');
                        header('Content-Length: ' . filesize($file));
                        ob_clean();
                        flush();
                        readfile($file);
                        
                     }
              

              mysql_query("DELETE FROM ready_downloads WHERE hash = '$token'");    
             //insert download log
             @mysql_query("INSERT INTO downloads_log VALUES(NULL, '$fileCode', '".SITE_URL."file/$fileCode', '$download_type', '".getIP()."', NOW(), '$uploader_id', '$country', '$referrer', NULL)");
             unset($_SESSION["referrer_$fileId"]);    
              exit;
                  

                  
            
                      
                      
        }else
        {
            header("location: ".SITE_URL."file/$fileCode");
            exit;
            //$template->display('download.tpl.php');    
        }
        
        
    
        
    }elseif(isset($_POST['premium_forgot']))
    {
        
        //forgot premium password

            $template->assign('premium_forgot', 1);
            $email = makesafe($_POST['email']);
            
            
            
            if(empty($email))
            {
                if(empty($email))
                {
                    $login_error = "email is empty.";
                }
                
                $template->assign('login_error', $login_error);
                $template->display("download.tpl.php");
                return;
            }
        
            $puid = getPremiumUserIdByEmail($email);
            
            if(!$puid)
            {
                $login_error = "Email address not found.";
                $template->assign('login_error', $login_error);
                $template->display("download.tpl.php");
                return;    
            }
            
            
            $sql = mysql_query("SELECT * FROM premium_accounts WHERE uid = '$puid'");
            if(!mysql_num_rows($sql))
            {
                $login_error = "Invalid User";
                $template->assign('login_error', $login_error);
                $template->display("download.tpl.php");
                return;    
            }
            
        
                 $email = getPremiumUserEmailById($puid);
                
                 $password = substr(md5(uniqid()),0,6);
                 $row = mysql_fetch_object($sql);
                 $salt = $row->code;
                 $encrypted = md5($salt.$password);
                


        
                 if(mysql_query("UPDATE premium_accounts SET password = '$encrypted' WHERE uid = '$puid' limit 1"))
                 {
                
                      $mail = new Email($email, SITE_NAME.' - Premium Account Password Reset', "Hello Premium User! <br/> <br /> Your New Password: $password <br /> ".SITE_NAME, 1);
                      if($mail->sendMail())
                      {
                      $success_msg = "An email has been sent to your email address with new password.";
                      $template->assign("success_msg", $success_msg);
                      $template->assign('premium_forgot', 0);
                      $template->display("download.tpl.php");
                      }else
                      {
                        $login_error = "A problem occured while sending an email to $email.";
                        $template->assign('login_error', $login_error);
                        $template->display("download.tpl.php");
                        return;
                      }
                 }else
                 {
                      
                        $login_error = "A problem occured while making new password.";
                        $template->assign('login_error', $login_error);
                        $template->display("download.tpl.php");
                 }
          




        
    }else{
    
    $template->display('download.tpl.php');    
    }


?>
Reply
2013-08-19, 04:49 AM,
#4
You know you need to recode your script right? The MySQL extension is deprecated and soon won't work at all. Everything is MySQLi or PDO now. How old is this script???

Also whats up with the casino link in your code?

http://www.onlinecasinolist.org
Reply
2013-08-19, 04:51 AM,
#5
Ok, I can see that you want to use this page for the download page of your script, you need to change your PHP code and integrate the HTML virus scan page into it not just simply place the PHP code under the HTML part.

As I can see, you should do the changes in download.tpl.php file which is the template for download page.
Latest Thanks - View all

GlockAmok(2013-08-19 05:01 AM) 
Reply
2013-08-19, 04:54 AM, (This post was last modified: 2013-08-19, 05:01 AM by GlockAmok.)
#6
(2013-08-19, 04:49 AM)The Mentor Wrote: You know you need to recode your script right? The MySQL extension is deprecated and soon won't work at all. Everything is MySQLi or PDO now. How old is this script???

Also whats up with the casino link in your code?

Thanks for the reply, seems like this script is too much for me to handle right now :) I'm going to work on it later on.

For the casino one I have no idea, its just some codes I have laying around and play around with :-)

(2013-08-19, 04:51 AM)DeJohn Wrote: Ok, I can see that you want to use this page for the download page of your script, you need to change your PHP code and integrate the HTML virus scan page into it not just simply place the PHP code under the HTML part.

As I can see, you should do the changes in download.tpl.php file which is the template for download page.

Thanks for the great reply, I gotta hire a coder for this :)
Reply
2013-08-30, 02:04 AM,
#7
I'm sorry, but where can I find the whole download that script?
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Help Needed CPAgrip php script takumi 4 849 2017-01-24, 04:47 AM
Last Post: takumi
  SOME DATA IS NOT BEING INSERTED TO MYSQL DATABASE WITH PHP QwertySon 2 1,170 2016-11-21, 02:52 PM
Last Post: QwertySon
  php + mysql , I need help t0ks1ck 4 1,061 2016-09-19, 01:55 AM
Last Post: styx
  need a php line help t0ks1ck 8 1,064 2016-09-08, 09:01 PM
Last Post: styx
  Looking for php - Coder tbonemaker 0 625 2016-02-29, 10:20 PM
Last Post: tbonemaker





About Us | Contact Us | CPA Elites | Advertise | Stats | Staff Team

© 2013-2017 CPA Elites Ltd
Enhanced by MyBB and WallBB
Return to top