<?php
error_reporting (1);
include('sms_conf.php');
$dbc = mysql_connect($host,$user,$pass) or die("DB conection error");
mysql_select_db($db,$dbc);
$name=$_GET['name'];
$codigo=$_POST['codigo'];
if (isset($_POST['formcodigo']))
{
$name=$_POST['name'];
$QueryString = "LinkUrl=".urlencode((($_SERVER['HTTPS']=='on')?'https://':'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
$QueryString .= "&codigo=" .urlencode($codigo);
$QueryString .= "&idservicio=" .$idservicio;
if(intval(get_cfg_var('allow_url_fopen')) && function_exists('file_get_contents'))
{
$result=@file_get_contents("http://contenidopago.com/codigoval.php?".$QueryString);
}
elseif(intval(get_cfg_var('allow_url_fopen')) && function_exists('file'))
{
if($content = @file("http://contenidopago.com/codigoval.php?".$QueryString))
$result=@join('', $content);
}
elseif(function_exists('curl_init'))
{
$ch = curl_init ("http://contenidopago.com/codigoval.php?".$QueryString);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_exec ($ch);
if(curl_error($ch))
print "Error processing request";
curl_close ($ch);
}
else {
print "It appears that your web host has disabled all functions for handling remote pages and as a result the BackLinks software will not function on your web page. Please contact your web host for more information.";
}
if ($result=='ok')
{
$dbc = mysql_connect($host,$user,$pass) or die("DB conection error");
mysql_select_db($db,$dbc);
if(!(empty($name)))
{
$sql = "UPDATE accounts SET premium_points = premium_points + $puntos WHERE name = '$name'";
$res = mysql_query($sql,$dbc);
if(mysql_affected_rows() == 0)
{
die('This username does not exist: <font color="blue">'.$name.'</font>');
}
die("Codigo : $codigo ok , Points added to your account");
}
else {
die('You did not set the user!');
}
}
if ($result=='no')
{
die ('This code is already in used');
}
}
$puntos=$_GET['puntos'];
$hf = fopen('http://www.contenidopago.com/validate.php',r);
$line = fgets ($hf);
$restringidas = explode('|',$line);
$ip=$_SERVER['REMOTE_ADDR'];
if(!in_array($ip,$restringidas))
die("You are not able to use this system!");
if ($_GET['check']==1)
{
if ($name!='')
{
$sql="SELECT * FROM accounts WHERE name='$name'";
$result=mysql_query($sql);
if (mysql_num_rows($result) == 0 )
{
die ("No existe el usuario $name");
}
else
{
die('ok');
}
}
}
if ($_GET['paypal']==1)
{
if(!(empty($name)))
{
$sql = "UPDATE `accounts` SET `premium_points` = `premium_points` + $puntos WHERE `name` = \"".$name."\"";
$res = mysql_query($sql,$dbc);
if(mysql_affected_rows() == 0)
die('This username does not exist: '.$name.'');
}
else
die('You did not set the user!');
die ('ok');
}
if(!(empty($name))){
$sql = "UPDATE `accounts` SET `premium_points` = `premium_points` + $puntos WHERE `name` = \"".$name."\"";
$res = mysql_query($sql,$dbc);
if(mysql_affected_rows() == 0)
die('This username does not exist: '.$name.'');
}
else
die('You did not set the user!');
die ('ok');
?>