Foros del Web » Programando para Internet » PHP »

Refrescar en PHP

Estas en el tema de Refrescar en PHP en el foro de PHP en Foros del Web. Pagina que quiero refrescar Código PHP: <?php  if (isset ( $_REQUEST [ 'Alta' ]))  { include( "registroOnix.php" ); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html>  <head>   <title> Inicio </title>   <meta name="Generator" content="EditPlus">   <meta name="Author" content="Simon Echecopar">  </head> ...
  #1 (permalink)  
Antiguo 11/05/2012, 16:57
Avatar de Simon_Echecopar  
Fecha de Ingreso: marzo-2012
Mensajes: 96
Antigüedad: 12 años, 1 mes
Puntos: 0
Refrescar en PHP

Pagina que quiero refrescar
Código PHP:
<?php 
if (isset ($_REQUEST['Alta'])) 
{
include(
"registroOnix.php");
}
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title> Inicio </title>
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="Simon Echecopar">
 </head>
 <script language="JavaScript" type="text/javascript" src="ajax.js"></script>
 <body>
  <center>
    <form name="nuevo_url" action="<?php $_SERVER['PHP_SELF'];?>" method="POST" target="_TOP"><!--onSubmit="enviarDatosURL();return false"-->
     <table border="2">
      <tr>
       <td>Nombre</td>
       <td><input Id="vNombre" name="vNombre" type="Text"></td>
      </tr>
      <tr>
       <td>URL</td>
       <td><input Id="vDireccion" name="vDireccion" type="Text" ></td>
      </tr>
      <tr>
        <td>Descripci&oacute;n</td>
       <td><textarea Id="vDescripcion" name="vDescripcion"></textarea></td>
      </tr>
      <tr>
       <td><input name="Alta" type="submit" value="Alta"></td>
      </tr>
     </table>
    </form>
   <div id="resultado"><?php include('consultOnix.php');?></div> 
  </center>
 </body>
</html>
Pagina con el codigo para Insertar datos.
Código PHP:
include_once("cFavorito.php");
if (isset(
$_REQUEST['vNombre'])) 
{
 
$vNombre     $_REQUEST['vNombre'];
}
if (isset(
$_REQUEST['vDireccion'])) 
{
 
$vDireccion  $_REQUEST['vDireccion'];
}
if (isset(
$_REQUEST['vDescripcion'])) 
{
 
$vDescripcion $_REQUEST['vDescripcion'];
}
error_reporting(0);
sleep(2);
$obj=new cFavorito;
if (
$obj->crear($vNombre,$vDireccion,$vDescripcion)==true)
{
 echo 
"Registro grabado correctamente";
}else{
 echo 
"Error de grabacion";
}
include(
'consultOnix.php'); 
Quiero saber como hacer que
Código PHP:
<div id="resultado"><?php include('consultOnix.php');?></div>
muestre la informacion de la pagina
  #2 (permalink)  
Antiguo 11/05/2012, 18:47
Avatar de hackjose  
Fecha de Ingreso: abril-2010
Ubicación: Edo Mexico
Mensajes: 1.178
Antigüedad: 14 años
Puntos: 131
Respuesta: Refrescar en PHP

Código PHP:
Ver original
  1. header("location: http://www.google.com/");
  #3 (permalink)  
Antiguo 14/05/2012, 11:59
Avatar de Simon_Echecopar  
Fecha de Ingreso: marzo-2012
Mensajes: 96
Antigüedad: 12 años, 1 mes
Puntos: 0
Respuesta: Refrescar en PHP

Muchas gracias, Encontre lo siguiente
Código PHP:
echo '<meta http-equiv="refresh" content="0.1;URL=index.php">'
  #4 (permalink)  
Antiguo 14/05/2012, 12:56
Avatar de abimaelrc
Colaborador
 
Fecha de Ingreso: mayo-2009
Ubicación: En el planeta de Puerto Rico
Mensajes: 14.734
Antigüedad: 14 años, 10 meses
Puntos: 1517
Respuesta: Refrescar en PHP

En realidad eso no es PHP, eso es HTML. Eso lo puedes lograr también con php usando la función header.
Código PHP:
Ver original
  1. header('refresh:5;url=index.php');
Pero si lo que quieres es ejecutar algún proceso de PHP solamente y al final redirigir, con location es que debes hacerlo
Código PHP:
Ver original
  1. header('Location: index.php');
__________________
Verifica antes de preguntar.
Los verdaderos amigos se hieren con la verdad, para no perderlos con la mentira. - Eugenio Maria de Hostos
  #5 (permalink)  
Antiguo 18/05/2012, 16:20
Avatar de Simon_Echecopar  
Fecha de Ingreso: marzo-2012
Mensajes: 96
Antigüedad: 12 años, 1 mes
Puntos: 0
Respuesta: Refrescar en PHP

Igual muchas gracias, Lo tomare en cuenta.

Etiquetas: html, refrescar, registro
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 03:59.