Foros del Web » Programando para Internet » PHP »

acortar url

Estas en el tema de acortar url en el foro de PHP en Foros del Web. 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 ) {*/      ...
  #1 (permalink)  
Antiguo 22/02/2009, 06:28
Avatar de engonga
Usuario no validado
 
Fecha de Ingreso: marzo-2002
Ubicación: Buenos Aires
Mensajes: 1.300
Antigüedad: 22 años
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();
?>
  #2 (permalink)  
Antiguo 22/02/2009, 06:36
Avatar de engonga
Usuario no validado
 
Fecha de Ingreso: marzo-2002
Ubicación: Buenos Aires
Mensajes: 1.300
Antigüedad: 22 años
Puntos: 8
Respuesta: acortar url

tengo que seguir poniendo el codigo pero FW me da error interno del servidor cuando intento escrivir i guardar....

os pongo un enlace con lo que queria poner aqui

http://an-a.es/foros_delweb.txt

en este txt esta todos los problemas que tengo
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 02:41.