Ver Mensaje Individual
  #4 (permalink)  
Antiguo 11/04/2008, 21:57
datasitesweb
 
Fecha de Ingreso: enero-2008
Ubicación: Argentina - la plata
Mensajes: 793
Antigüedad: 16 años, 4 meses
Puntos: 21
Re: problema con script

Todo el codigo es este :

$ruta = "data.txt"; // Donde guardaremos
// Los datos .
$wwwurl = "www.paintballweb.com.ar"; //url de tu sitio Web (Sin http://).A donde $textsnumero = 15 ; // cada cuanto paginaremos a los afiliados
$char = 200 ; // numero de caractéres que se mostraran en las descripciones
// de cada web .
$vacio = "vacio.gif"; // Minibanner que se muestra para webs sin botón .
$webmail = "[email protected] "; // Donde recibirás
// las propuesta de
// afiliación .

if(empty($HTTP_GET_VARS['ant'])){ $ant = 0 ; }
$adp = md5 ($adp);
if (!file_exists($ruta)){ $f1=fopen("$ruta","w+"); fclose($f1); } // si el archivo para guardar los datos no existe lo creamos
$modo = $HTTP_GET_VARS['modo'];
$quiero = $HTTP_GET_VARS['quiero'];
$password = $HTTP_POST_VARS['password'] ;
$password = md5($password);
if ($modo == admin && $quiero == "desconectar" ){
setcookie ("admin",$password,time()-86400);
echo "<br><br><br><br><center><h4>Has sido desconectado correctamente<br>A partir de ahora, las webs que envíes serán registradas en tu dirección de e-mail<br>en tu lista de afiliados<br><br><br><br><br><a href='webs.amigas.php'>[ Regresar ]</h4></center></a><br>";
die ();
}
if ($modo == admin && $adp == $password ){
setcookie ("admin",$password,time()+86400);
echo "<br><br><br><br><center><h4>Has sido identificado correctamente<br>A partir de ahora, las webs que envíes serán guardadas<br>en tu lista de afiliados<br><br><a href='webs.amigas.php'>[ Regresar ]</a><br></h4></center><br><br><br>";
die ();
}
if ($modo == admin ){ ?>
<link href="<?php echo "$css"; ?>" rel="stylesheet" type="text/css">
<link href="Template068.css" rel="stylesheet" type="text/css">
<link href="Template068.css" rel="stylesheet" type="text/css">
<link href="Template068.css" rel="stylesheet" type="text/css">
<div align="center"><br><br><br><br><br>
<form name="admin" method="post" action="<?php echo $PHP_SELF ?>">
Introduzca su password :
<input name="password" type="password" id="password">
<input name="Enviar" type="submit" value="Identificar">
</form>
</div>
<?php
die ();
}
$refid = $HTTP_GET_VARS['refid'];
if (!empty($refid)){
$archivo = file("$ruta", "r");
function visita_afi($refid,$archivo){
for ($i = 0 ; $i < count($archivo); $i++){
$datos = explode (":||:", $archivo[$i]);
if ($refid == $datos[0]){
Header("Location: $datos[2]");
die();
}
}
}
visita_afi($refid,$archivo);
}
$afidesc = $HTTP_POST_VARS['afidesc'];
$afiweb = $HTTP_POST_VARS['afiweb'];
$afiurl = $HTTP_POST_VARS['afiurl'];
$afilogo = $HTTP_POST_VARS['afilogo'];
$aficat = $HTTP_POST_VARS['aficat'];
$afival = $HTTP_POST_VARS['afival'];
$afimail = $HTTP_POST_VARS['afimail'];
$admin = $HTTP_COOKIE_VARS['admin'] ;
if ($admin == $adp && !empty($afidesc) && !empty($afiweb) && !empty($afiurl) && !empty($aficat)){
$date = getdate();
$afidesc = str_replace("\n", "<br>", $afidesc);
$afidesc = str_replace(":||:", " ", $afidesc);
$afifile="$ruta";
$pw1 = rand();
$pw = rand();
$pw1 = md5($pw1);
$pw = md5($pw);
$pw = "$pw$pw1";
$pw = md5($pw); // id de la web generado
$aficribe="$pw:||:$afiweb:||:$afiurl:||:$afilogo:| |:$aficat:||:$afival:||:$afidesc:||:$date[mday]-$date[mon]-$date[year]:||:$ip:||:\n";
$abreafi=fopen($afifile, "a+");
fwrite($abreafi, "${aficribe}");
fclose($abreafi);
echo "<link href='$css' rel='stylesheet' type='text/css'>
<br><br><br><center><h4>¡¡ NUEVO AFILIADO AÑADIDO !!</h4></center></b>";
}
if ($admin !== $adp && !empty($afidesc) && !empty($afiweb) && !empty($afiurl) && !empty($aficat)){
$elmail = "$webmail";
$ertema = "$nombresitio : Afiliar Web";
$mensaje = "Hola Administrador !!
Tenemos alguien nuevo que quiere afiliarse .
Nombre de la Web : $afiweb
Url de la Web : $afiurl
Descripción : $afidesc
Categoría : $aficat
minibanner : $minibanner
Mail de contacto : $afimail
";
mail($elmail,$ertema,$mensaje,"From: $webmail\r\nReply-To: $webmail\r\n");
$elmail = "$afimail";
$ertema = "$nombresitio : Nuevo afiliado";
$mensaje = "Estimado Webmaster .
Hemos recibido una proposición de su web
para afiliarse a $wwwurl .
Los datos que hemos recibido son los siguientes :
Nombre de la Web : $afiweb
Url de la Web : $afiurl
Descripción : $afidesc
Categoría : $aficat
minibanner : $minibanner
Mail de contacto : $afimail
Valoración : $afival
En breve revisaremos su web, si ha colocado un enlace
a $wwwurl pronto estaremos intercambiando visitas .
Saludos, el webmaster de $wwwurl .
";
mail($elmail,$ertema,$mensaje,"From: $webmail\r\nReply-To: $webmail\r\n");
echo "<link href='$css' rel='stylesheet' type='text/css'><br><br><br><br><br><br><br><br><br><table width=\"300\" border=\"0\" align=\"center\" cellpadding=\"8\" cellspacing=\"1\" bgcolor=\"#000000\">
<tr>
<td bgcolor=\"#FFFFFF\">Estimado Webmaster .<br><br>
Hemos recibido su proposición para afiliarse a $wwwurl .<br><br>
Los datos que hemos recibido son los siguientes :<br><br>
<b>Nombre de la Web :</b> $afiweb<br>
<b>Url de la Web :</b> $afiurl<br>
<b>Descripción :</b> $afidesc<br>
<b>Categoría :</b> $aficat<br>
<b>minibanner :</b> $minibanner<br>
<b>Mail de contacto :</b> $afimail<br>
<b>Valoración :</b> $afival<br><br><br>
En breve revisaremos su web, si ha colocado un enlace
a $wwwurl pronto estaremos intercambiando visitas .
<br><br>
Saludos, el webmaster de $wwwurl .</td>
</tr>
</table><br><br>";
echo "</td>
</tr>
</table></td>
</tr>
</table> </td>
</tr>
</table></td>
</tr>
</table>";
die();
}
?>
<link href="<?php echo "$css"; ?>" rel="stylesheet" type="text/css">
<body bgcolor="#D8E9ED">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#698FB6">
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="1">
<tr>
<td width="28%" valign="top" bgcolor="#FFFFFF">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#990000">
<tr>
<td height="20" align="center" class="11PIX"><b><?php echo "$nombresitio"; ?>&nbsp;-
Enl&aacute;zanos</b></td>
</tr>
<tr>
<td align="center" bgcolor="#FFFFFF"> <br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><a href="<?php echo "http://$wwwurl"; ?>" target="_blank"><img src="<?php echo "$nuestro"; ?>" width="88" height="31" border="0"></a>
<br>
<textarea name="textarea" cols="25" rows="3" readonly="readonly" wrap="virtual"><a href="<?php echo "http://$wwwurl"; ?>" target="_blank"><img src="<?php echo "$siteurl/$nuestro"; ?>" border="0"></a> </textarea></td>
</tr>
</table>
Solo ser&aacute;n aceptadas las webs que coloquen un enlace
reciproco a <?php echo "$wwwurl"; ?></td>
</tr>
</table>
<br>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#990000">
<tr>
<td height="20" align="center" class="11PIX"><b>A&ntilde;adir&nbsp;-
AfiliarWeb </b></td>
</tr>
<tr>
<td height="80" bgcolor="#FFFFFF">
<form action="<?php echo $PHP_SELF ; ?>" method="post" name="afi" id="afi">
Nombre del Sitio<br>
<input name="afiweb" type="text" id="afiweb">
<br>
Url del Sitio<br>
<input name="afiurl" type="text" id="afiurl" value="http://">
<br>
Mail de contacto<br>
<input name="afimail" type="text" id="afimail" value="@">
<br>
Logo o minibanner del Sitio (88x31 Pixeles)<br>
<input name="afilogo" type="text" id="afilogo" value="http://">
<br>


Breve Descripci&oacute;n del Sitio &nbsp;Solo se mostraran
los primeros <?php echo "$char caractéres ." ?><br>
<textarea name="afidesc" cols="25" rows="5" wrap="VIRTUAL" id="afidesc"></textarea>
<input type="submit" name="Submit" value="Enviar Web">
<br>
<br>
</form></td>
</tr>
</table>
</td>
<td width="72%" align="center" valign="top" bgcolor="#FFFFFF">
<table width="99%" border="0" cellspacing="8" cellpadding="0">
<tr valign="top">
<td width="17%">&nbsp;</td>
<td width="59%" align="center" class="11PIX"><b>Webs Afiliadas
a <?php echo "$nombresitio"; ?></b><br>
<br>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#000000">
<tr>
<td bgcolor="#FFFFFF"><?php
$lectura = $ant + $textsnumero;
$archivo=file("$ruta", "r");
function paginacion($ruta,$mod,$textsnumero,$archivo) {
if($textsnumero < count($archivo)) {
$paginas = count($archivo) / $textsnumero;
echo "<center><b>Páginas : </b>";
for($i = 0; $i < $paginas; $i++) {
echo "<a href=webs.amigas?ant=". $i * $textsnumero .">". ( $i + 1 )."</a>\n";
}
return;
}
}
paginacion($ruta,$mod,$textsnumero,$archivo);
?></td>
</tr>
</table> <br></td>
<td width="24%"></td>
</tr>
<?php ///vamos a sacar a los afiliadetes
$archivo = file("http://www.paintballweb.com.ar/webamigas/data.txt", "r");
function mostrar_indice($vacio,$ruta,$char,$ant,$textsnumer o,$lectura,$archivo){
for ($i = $ant ; $i < count($archivo) and $i < $lectura; $i++){
$datos = explode (":||:", $archivo[$i]);
if (empty($datos[3])){
$datos[3] = "$vacio";
}
if ($datos[3] == "http://"){
$datos[3] = "$vacio";
}
$datos[6] = stripslashes($datos[6]);
$datos[1] = stripslashes($datos[1]);
$datos[1] = ucfirst("$datos[1]");
echo "<tr valign=\"top\">
<td><hr size=1><a href=\"webs.amigas?refid=$datos[0]\" target=\"_blank\"><img src=\"$datos[3]\" width=\"88\" height=\"31\" border=\"0\" alt=\"Visita $datos[1]\"></a></td>
<td><hr size=1><a href=\"webs.amigas?refid=$datos[0]\" target=\"_blank\"><b>$datos[1]</b></a><br>";
$datos[6] = ucfirst("$datos[6]");
$datos[6] = substr("$datos[6]",0,$char);
echo "$datos[6] ...";
echo "</td>
<td><hr size=1><b>Categor&iacute;a :</b> $datos[4]<br>
<b>Registro :</b> $datos[7]<br> <b>Valoraci&oacute;n :</b>
$datos[5]</td>
</tr>";
}
}
mostrar_indice($vacio,$ruta,$char,$ant,$textsnumer o,$lectura,$archivo);