Foro de elhacker.net

Programación => PHP => Mensaje iniciado por: shamaka en 5 Diciembre 2010, 21:15 pm



Título: Como cambiar la función de un script en PHP??
Publicado por: shamaka en 5 Diciembre 2010, 21:15 pm
Hola amigos.

Estos últimos días me he estado volviendo loco tratando de hacer una combinación de las funciones de dos script totalmente diferentes. Los script son de una pagina PTC.

La version 3.0 de este script tiene un bugs del cual muchos desconsiderados se aprovechan, cuando un usuarios hace clic en uno de los anuncios empieza a correr con contador regresivo de 30 segundos. Al terminar este presenta un visto bueno que certifica que se ha acreditado la ganancia al usuario. Por medio de este signo es que proceseden hacer sus trampas.

La version 4 de este scrip no tiene este problema, ya que cuando el contador llega a cero, abre una ventana emergente pidiendo confirmación para dar el crédito.

Necesito una persona con conocimientos en PHP y programación que pueda ayudarme, es muy urgente!!!

acá les dejo las funciones de ambos script, gracias de ante mano.


Versión 3



<?
session_start();


require('config.php');
require('funciones.php');



$adse=limpiar($_GET["ad"]);



if(!isset($_COOKIE["usNick"]) && !isset($_COOKIE["usPass"]))
{
      $sqlz = "SELECT * FROM tb_ads WHERE id='$adse'";
      $resultz = mysql_query($sqlz);         
      $myrowz = mysql_fetch_array($resultz);

$numero=$myrowz["outside"];

      $sqlex = "UPDATE tb_ads SET outside='$numero' +1 WHERE id='$adse'";
      $resultex = mysql_query($sqlex);

}


$checkad = mysql_query("SELECT id FROM tb_ads WHERE id='$adse'");
$ad_exist = mysql_num_rows($checkad);

if ($ad_exist<1) {
// En caso de no existir el referer damos un mensaje de error
echo "Error"; exit();
}


?>


<html>

<head>

<meta http-equiv="Pragma" content="no-cache">

<meta http-equiv="Expires" content="-1">

<link rel="stylesheet" type="text/css" href="css.css"><title><? include('sitename.php'); ?> | Espere por su dinero</title>

<script>

var x = 31

var y = 1

function startClock(){

if(x!=='Done'){

x = x-y

document.frm.clock.value = x

setTimeout("startClock()", 1000)

}

if(x==0){

x='Done';

document.frm.clock.value = x;

success.location.href="successp.php?ad="+document.frm.id.value+"&verify="+document.frm.verify.value;

}}

</script>

             
            <body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0" onLoad="startClock()">


             

            <form name="frm" method="post">
             
            <input type="hidden" name="id" value="<? echo $adse ?>">
             
<input type="hidden" name="verify" value="<? include('thecodero.php'); ?>">
             
             <table border="0" cellpadding="0" cellspacing="0" width="100%">
             
                <tbody>
             
                  <tr> 
             
                    <td class="maintopright" style="border-bottom: 2px solid rgb(51, 51, 51); font-family: Verdana; font-size: 13px;" width="50%">
             
                      <div class="maintopright">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;

             
                      <input name="clock" size="3" readonly="readonly" style="border: medium none ; padding: 0pt; font-size: 25pt; font-family: Verdana; vertical-align: top;" type="text">
             
                      <iframe name="success" src="grayblank.htm" border="0" framspacing="0" marginheight="0" marginwidth="0" vspace="0" hspace="0" style="vertical-align: top;" frameborder="0" height="40" scrolling="no" width="40"></iframe>
             
                      </div>
             
                    </td>
             
                    <td style="border-bottom: 2px solid rgb(51, 51, 51); font-family: Verdana; font-size: 13px; " align="left" valign="middle" width="50%">
             
                        <strong>Espere que el contador llegue a cero y aparezca $.<br>
             
                     </td>
             
                    </tr>
             
                  </tbody>
             
             </table>
             
             <iframe src="<? require ('config.php');
$sql = "SELECT * FROM tb_ads WHERE id='$adse'";
$result = mysql_query($sql);         
$row = mysql_fetch_array($result);


echo $row["url"];
?>" border="0" framspacing="0" marginheight="0" marginwidth="0" vspace="0" hspace="0" frameborder="0" height="100%" scrolling="yes" width="100%"></iframe>
             



            </form>
             
            </body>
             
             
</html>


Version 4


<?php
 session_start(); include('includes/config.inc.php'); $myDb->connect(); $sql = "SELECT * FROM yob_site WHERE id='1'"; $result = mysql_query($sql); $row = mysql_fetch_array($result); $myDb->close(); define('AD_TIMER',$row['adtimer']);  $logged_in=isset($_COOKIE["usNick"]) && isset($_COOKIE["usPass"]); $ad_id=limpiar($_GET["ad"]); $myDb->connect(); $ad_result=mysql_query("SELECT * FROM yob_ads WHERE id='$ad_id'"); $myDb->close();  if (mysql_num_rows($ad_result)==0) { echo "Ad doesn't exist"; exit(); } $ad_row=mysql_fetch_array($ad_result);  if(!$logged_in) { $myDb->connect(); mysql_query("UPDATE yob_ads SET outside=outside+1 WHERE id='$ad_id'"); $myDb->close(); }   function get_codes($num,$len) { for($i=0;$i<$num;++$i) { $codes[]=substr(strtoupper(md5(rand(1000,1000000000))),0,$len); } return $codes; } $codes=get_codes(4,3); $_SESSION['captcha']=$codes[rand(0,count($codes)-1)]; $mycode = $_SESSION['captcha']; ?>
<html>
    <head>
        <title><?php echo SITENAME." - ".SITESLOGAN; ?></title>
        <link rel="stylesheet" type="text/css" href="css/adview.css">
        <style type="text/css">
            <?php if($logged_in): ?>
            #header {background: #666 url("images/sprites.gif") repeat-x 0 100%;margin: 0 0 25px;padding: 0 0 8px;height:45px}
            #header #clock {font: 265% arial;letter-spacing: -.05em;margin:0 0 0 40px;padding:3px 0;color:#ccc;border:none; float:left;position:fixed;width:50%}
            #header #site-name {font: 265% arial;letter-spacing: -.05em;margin:0 40px 0 0;padding:3px 0;color:#ccc;border:none; float:right;position:relative}
            * {margin:0;padding:0}
body {padding: 0 0 20px;background: #fff;font:83%/1.5 arial,tahoma,verdana,sans-serif}

            <?php else: ?>
            #message { position: absolute; top:0; left:0; width:100%; height: 30px; color:#fff;  background: #000; text-align:center; z-index: 10000; }
            <?php endif; ?>
            iframe { position: absolute; left:0;top:50;width:100%;height:100%; z-index: 100; }
        </style>
        <meta http-equiv="Pragma" content="no-cache">
        <meta http-equiv="Expires" content="-1">
        <?php if($logged_in): ?>
        <script type="text/javascript">
        var t = <?php echo AD_TIMER ?>;
        var decr = 1;
        var handle = null;
        var e = null;
        function startTimer() {
        if(!e)
        e = document.getElementById("time");
        e.innerHTML = t;
        handle = setInterval(function() {
        if(t == 0) {
        clearInterval(handle);

                var answer = confirm("Desea obtener creditos por esta visita?")
                if (answer){
                    alert("Bien! Su cuenta ha sido acreditada")
                    window.location = "visit.php?ad=<?php echo $ad_id; ?>&code=<?php echo $mycode;?>&url=<?php echo $ad_row['url']; ?>";
                }
                else{
                    alert("Su cuenta NO se acreditó!")
                }


        }
        else {
        t -= decr;
        e.innerHTML = t;
        }
        }, decr * 1000);
        }
        window.onload = startTimer;
        </script>
        <?php endif; ?>
    </head>
     
    <body>
    <?php if($logged_in): ?>
    <div id="header">
    <div id="clock"><span id="time"></span></div>
    <div id="site-name"><?php echo SITENAME ?></div>
    </div>
    <?php else: ?>
        <div id="message">
           Para obtener créditos, inicie sesión 
        </div>
    <?php endif; ?>

    <iframe src="<?php echo $ad_row['url']; ?>" border="0" framespacing="0" marginheight="0" marginwidth="0" vspace="0" hspace="0" frameborder="0" height="100%" scrolling="yes" width="100%" id="site"></iframe>
    </body>
</html>


Título: Re: Como cambiar la función de un script en PHP??
Publicado por: seele en 6 Diciembre 2010, 12:32 pm
todavia no entiendo bien que quieres hacer, ademas de que pareciera que solo pides que hagamos todo el trabajo por ti..... la idea es que aprendas