Vanilla 1.1.10 es un producto de Lussumo. Para más información: Documentación, Soporte.
1 a 20 de 20
<noscript>
Posted By: Javi¿tiene javascript activo?
SI-> Enviar a formulario2.php
NO-> Se quede en el formulario1.php
<script>
document.location.href='http://example.com/formulario2.php';
</script>
Posted By: Javi<script>
document.location.href='http://example.com/formulario2.php';
</script>
Posted By: Javi<script>
document.location.href='http://example.com/formulario2.php';
</script>
if (X_ENABLED == 'True'){
echo "<script>
document.location.href='http://www.x.com/formulario2.php/'
</script>";
}
header('Location: ' . $url);
Posted By: dominoticoHacer la de javascript tambien en php, usando: header('Location ....)
<?php
if (isset($_POST['jstest'])) {
$nojs = FALSE;
} else {
// create a hidden form and submit it with javascript
echo '<form name="jsform" id="jsform" method="post" style="display:none">';
echo '<input name="jstest" type="text" value="true" />';
echo '<script language="javascript">';
echo 'document.jsform.submit();';
echo '</script>';
echo '</form>';
// the variable below would be set only if the form wasn't submitted, hence JS is disabled
$nojs = TRUE;
}
if ($nojs) {
//JS is OFF, do the PHP stuff
}
?>
Posted By: dominoticopermite detectar si Javascript esta activado
<?php
if (isset($_POST['jstest'])) {
$js = TRUE;
} else {
// create a hidden form and submit it with javascript
echo '<form name="jsform" id="jsform" method="post" style="display:none">';
echo '<input name="jstest" type="text" value="true" />';
echo '<script language="javascript">';
echo 'document.jsform.submit();';
echo '</script>';
echo '</form>';
// the variable below would be set only if the form wasn't submitted, hence JS is disabled
$js = FALSE;
}
if ($js == TRUE) {
if (X_ENABLED == 'True') {
$url = 'http://www.x.com/formulario2.php/';
header('Location: ' . $url);
}
}
?>
Posted By: Javimetodo curioso, me lo apunto dominotico gracias!
Posted By: dominoticoEl merito es de Google ...
Posted By: CMVBueno pues muchas gracias dominotico, ya funciona.
Al final antes de los formularios paso por un archivo que mira si hay JS o no: si lo hay redirecciona mediante script y si no lo hay redirecciona mediante meta refresh. Lo he tenido que hacer así porque si lo pongo en el Formulario1 directamente, al tener redirecciones en PHP justo después de la comprobación de Java, estas se ejecutan primero y nunca conseguiría redirigir a Formulario2.php.
Gracias a todos! Es un buen método y sobretodo útil ya que no hay muchas formas de resolverlo
Posted By: dominoticoNo entiendo bien tu dificultad
1 a 20 de 20