Tema: acortar url
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/02/2009, 06:28
Avatar de engonga
engonga
Usuario no validado
 
Fecha de Ingreso: marzo-2002
Ubicación: Buenos Aires
Mensajes: 1.300
Antigüedad: 22 años, 1 mes
Puntos: 8
acortar url

hola estoy armando un acortador de urls tipo tinyurl.com

tengo esto

index,php
Código PHP:
<?php
ob_start
();

require(
"config.php");
require(
"forward.php");

/*if ($config['rewrite'] == false && strlen($_SERVER['QUERY_STRING']) == 6 or strlen($_SERVER['QUERY_STRING']) > 1 ) {*/
    
 /*print("hola");
    exit;
}*/

if ($config['recaptcha']) {
    require(
"recaptchalib.php");
}
else if (
$config['captcha']) {
    
session_start();
    
mt_srand((double) microtime() * 1000000);
    
$_SESSION['captcha_phrase'] = substr(strtoupper(md5(mt_rand())), 06);
    
session_write_close();
}
require(
"header.php");
?>
<style type="text/css">
<!--
.Estilo1 {
 color: #FF0000;
 font-weight: bold;
}
-->
</style>
Reduce URL interminables
<br />
<form method="post" action="create.php">
<div class="FormBody">
<strong>Entra la URL a reducir:</strong><br />
<input type="text" name="url" size="80" />
<br />
<br /><br /><br />
<?php
if ($config['recaptcha']) {
    echo 
recaptcha_get_html($config['recaptcha_publickey']);
}
else if (
$config['captcha']) {
    echo 
"<strong>Codigo de Seguridad:</strong><br />\n".
         
"<img src=\"captcha.php\" alt=\"\"/> <input type=\"text\" name=\"captcha\" size=\"10\" /><br />\n";
}
?>
<input type="submit" value="Reducir" />
</div>
</form>

  <form method="post" action="create2.php">
<div id="nuevo_serv">
Nuevo Serv&iacute;cio <span class="Estilo1">BETA
</span><br />
Ahora puedes poner tu la direcci&oacute;n!!!
<strong><br />
Entra la URL a reducir:</strong><br />
<input type="text" name="url" size="80" />
<br />
<br />
<?php
if ($config['recaptcha']) {
    echo 
recaptcha_get_html($config['recaptcha_publickey']);
}
else if (
$config['captcha']) {
    echo 
"<strong>Codigo de Seguridad:</strong><br />\n".
         
"<img src=\"captcha.php\" alt=\"\"/> <input type=\"text\" name=\"captcha\" size=\"10\" /><br />\n";
}
?>
<br />
<strong>Nombre que deseas...</strong><br />
<input type="text" name="nom_sugest" size="20" id="nom_sugest" />
<em><br />
</em><br />
<input type="submit" value="Reducir" />
</div>
  </form>
<div class="MainTitle"><strong>Ejemplo:</strong></div><br />
Copia esta URL:<br /><br />
<pre class="ExampleBody">http://rds.yahoo.com/_ylt=A9htfToQDdpDumkAjWxXNyoA;_ylu=X3oDMTE2N
GhncHQwBGNvbG8DZQRsA1dTMQRwb3MDMQRzZWMDc3IEdnRpZANGNjk
yXzg2/SIG=117jf2up8/EXP=1138450064/**http%3a//example.com/</pre>
ponla en el cajetin y le des a &quot;Reducir&quot; y:<br />
<br />
<strong>http://an-a.es/f561d5</strong><br />
<br />
Esta es la URL  que tendras que pegar en tu blog o en Facebook o donde quieras 
<?php
require("footer.php");
ob_end_flush();
?>