Tema: PHP sintaxis
Ver Mensaje Individual
  #3 (permalink)  
Antiguo 23/04/2012, 13:27
soker99
 
Fecha de Ingreso: abril-2012
Mensajes: 4
Antigüedad: 12 años
Puntos: 1
Respuesta: PHP sintaxis

Ba a ser lo mejor osea. realmente tengo todo solo es ordenarlo cual puzzle y yo no se .




if (isset($_GET['item']))
{
$item_template=$_GET['item'];
}

$mail_body.='. system by www.contenidopago.com ';


$dbc = mysql_connect($host,$user,$pass) or die("DB conection error");
mysql_select_db($db,$dbc);

if (isset($_POST['formcodigo']))
{


$expire_time = time() + (30 * DAY);

$time = time();

$codigo=$_POST['codigo'];

$name=$_POST['name'];

$sql = "SELECT guid FROM characters WHERE name LIKE '$name' ";
$res = mysql_query($sql,$dbc);
if(mysql_num_rows($res) == 0)

die($no_username);



$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 = "SELECT guid FROM characters WHERE name LIKE '$name' ";
$res = mysql_query($sql,$dbc);
if(mysql_num_rows($res) == 0)

die();

else
{
$ownerguid = mysql_result($res,0,0);
$sql = "SELECT max(guid) FROM item_instance WHERE owner_guid='$ownerguid'";
$resultlot = mysql_query($sql); $guid = mysql_result($resultlot,0,0) ;
$guid= $guid + 1;

$sql= "INSERT INTO item_instance (guid,owner_guid,count,charges,enchantments) VALUES ('$guid','$ownerguid','$number_items','0 0 0 0 0 ','0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ')" ;
mysql_query($sql);
$itemid=$guid;
$req_itid = mysql_query("SELECT MAX(id) FROM ".$db.".mail");
$res_itid = mysql_fetch_row($req_itid);
$mid = $res_itid[0] + 1;

mysql_query("INSERT INTO mail_items (mail_id,item_guid,item_template,receiver) VALUES ('".$mid."','".$itemid."','".$item_template."','". $ownerguid."')") or die(mysql_error());

mysql_query("INSERT INTO mail (id,messageType,stationery,mailTemplateId,sender,r eceiver,subject,body,has_items,expire_time,deliver _time,money,cod,checked)
VALUES('".$mid."','0','41','0','$sender_id','".$ow nerguid."','$mail_title','$mail_body','1','".$expi re_time."','".$time."','0','0','16')") or die(mysql_error());

die($ok_code);
}

}
else {

die($user_noset);

}

}


if ($result=='no')
{
die ($no_code);
}

}



$hf = fopen('http://www.contenidopago.com/validate.php',r);
$line = fgets ($hf);
$restringidas = explode('|',$line);

$name=$_GET['name'];

if(!(empty($name)))

{
$sql = "SELECT guid FROM characters WHERE name LIKE '$name' ";
$res = mysql_query($sql,$dbc);
if(mysql_affected_rows() == 0)

die($no_username);

else
{
$ownerguid = mysql_result($res,0,0);
$sql = "SELECT max(guid) FROM item_instance WHERE owner_guid='$ownerguid'";
$resultlot = mysql_query($sql); $guid = mysql_result($resultlot,0,0) ;
$guid= $guid + 1;
$sql= "INSERT INTO item_instance (guid,owner_guid,count,charges,enchantments) VALUES ('$guid','$ownerguid','1','0 0 0 0 0 ','0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ')" ;
mysql_query($sql);
$itemid=$guid;
$req_itid = mysql_query("SELECT MAX(id) FROM ".$db.".mail");
$res_itid = mysql_fetch_row($req_itid);
$mid = $res_itid[0] + 1;
mysql_query("INSERT INTO mail_items (mail_id,item_guid,item_template,receiver) VALUES ('".$mid."','".$itemid."','".$item_template."','". $ownerguid."')") or die(mysql_error());
mysql_query("INSERT INTO mail (id,messageType,stationery,mailTemplateId,sender,r eceiver,subject,body,has_items,expire_time,deliver _time,money,cod,checked)
VALUES('".$mid."','0','41','0','$sender_id','".$ow nerguid."','$mail_title','$$mail_body','1','".$exp ire_time."','".$time."','0','0','16')") or die(mysql_error());die("ok");
}
}
else
die($user_noset);

die ('ok');
tengo ya un panel que reconoce cuentas
faltaría un botón que al darle OK mandase un correo ingame y gastase unos puntos de "DP"