Ver Mensaje Individual
  #4 (permalink)  
Antiguo 30/01/2015, 15:59
Juan228
 
Fecha de Ingreso: febrero-2008
Mensajes: 65
Antigüedad: 16 años, 3 meses
Puntos: 0
Respuesta: Como modificar link con Javascript

Hola! Gracias a los dos, probe y no pude, me sigue tirarndo el mismo error:


Forbidden

You don't have permission to access /formulario/mostrar.php on this server.
----------------------------------------

Les paso mis dos archivos asi los ven, tal vez coloque mal las cosas.

formulario.php
Código:
<!DOCTYPE html>     
<html>
<head>
<title>Formulario de contacto</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
      <script type="text/javascript">
         window.onload = function () {
            var test = document.getElementById('test');
            var boton = document.getElementById('boton');
 
            boton.addEventListener('click', function (e) {
               e.preventDefault();
               var url = document.getElementById('url').value;
               var string = url.substring(7); // eliminar http://
               test.innerHTML = string;
            });
         };
      </script>
</head>
<body>
<form name="formulario" method="post" action="mostrar.php">
<table width="423" border="0" align="center">
  <tr>
    <td width="166">Datos de la Pelicula: </td>
    <td width="247"><input id="datos" type="text" name="datos" placeholder="Datos" required="" /></td>
    </tr>
  <tr>
    <td><div align="center">
      <p>Sinopsis:    </div></td>
    <td><input id="sin" type="text" name="sin" placeholder="Sinopsis" required="" /></td>
  </tr>
  <tr>
    <td>Captura de Pantalla:
      <div align="center"></div></td>
    <td><input id="cap" type="text" name="cap" placeholder="Captura" required="" /></td>
  </tr>
  <tr>
    <td colspan="2">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2"><input name="submit" type="submit" /></td>
  </tr>
</table>
</form>
<script>
document.querySelector("formulario").addEventListener("submit", function(event){
    event.preventDefault(); //Evito el envío de la información
 
    var caja = this.querySelector("datos"); //Tomo a la caja de texto
 
    caja.value = caja.value.replace(/(https?:\/\/|www\.)/gi, ""); //Hago el filtrado
 
    this.submit(); //Envío el formulario
}, false);
</script>
</body>
</html>

mostrar.php
Código PHP:
 <?php

$datos 
$_POST['datos'];
$sin $_POST['sin'];
$cap $_POST['cap'];
$url '[noparse][url]';
$img '[img]';
$cen '[center]';
$url_c '[/url][/noparse]';
$cen_c '[/center]';
$img_c '[/img]';


echo 
$url$datos$url_c;
echo 
$cen$sin$cen_c;
echo 
$img$cap$img_c;

?>
No se que estare haciendo mal :(

Última edición por Juan228; 30/01/2015 a las 16:20