gracias por la ayuda; estoy intentado implementar el codigo en mi formulario; index.php; pero me arroja el siguiente error:
Cita: Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/citecper/public_html/sistema/index.php:36) in /home/citecper/public_html/sistema/ingreso.php on line 2
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/citecper/public_html/sistema/index.php:36) in /home/citecper/public_html/sistema/ingreso.php on line 2
mi cabecera esta de la siguiente manera index.php:
Código PHP:
<?
session_start();
/*header ("Expires: Thu, 27 Mar 1980 23:59:00 GMT"); //la pagina expira en una fecha pasada
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); //ultima actualizacion ahora cuando la cargamos
header ("Cache-Control: no-cache, must-revalidate"); //no guardar en CACHE
header ("Pragma: no-cache");*/
require_once("config/config.php");
require_once("include/clasesmysql.php");
$miconexion = new DB_mysql ;
$miconexion->conectar($basededatos, $host, $usuario_bd,$contrasena_bd);
require_once("include/class.tree.php");
require_once("include/funciones.php");
set_time_limit(0);
session_write_close();
if(isset($_POST['control'])){
ignore_user_abort(1);
while (1) {
echo "\n";
ob_flush();
flush();
sleep(5);
if (connection_status()!=0){
session_start();
session_destroy();
exit;
}
}
exit;
}
?>
Cita: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>..::CITEC::..</title>
<script type="text/javascript" src="js/lib/prototype.js"></script>
<script type="text/javascript" src="js/lib/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="js/modalbox.js"></script>
<link rel="stylesheet" href="css/modalbox.css" type="text/css" media="screen" />
<link href="css/citec.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/embeddedcontent.js" defer="defer"></script>
<script type="text/javascript" src="js/ajax.js"></script>
<script type="text/javascript" src="js/tree.js"></script>
<script type="text/javascript" src="js/myajax.js"></script>
<script type="text/javascript" src ="js/titulo.js"> </script>
<script type="text/javascript" src="flash/stmenu.js"></script>
<script type="text/javascript">
<!--
window.onerror=function(m,u,l)
{
window.status = "Java Script Error: "+m;
return true;
}
//-->
</script>
<script>
function http(){
if(typeof window.XMLHttpRequest!='undefined'){
return new XMLHttpRequest();
}else{
try{
return new ActiveXObject('Microsoft.XMLHTTP');
}catch(e){
alert('Su navegador no soporta AJAX');
return false;
}
}
}
function request(url,callback,params){
var H=new http();
if(!H)return;
H.open('post',url+'?'+Math.random(),true);
H.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
H.onreadystatechange=function(){
if(H.readyState==4){
if(callback)
callback(H.responseText);
H.onreadystatechange=function(){}
H.abort();
H=null;
}
}
var p='';
for(var i in params){
p+='&'+i+'='+escape(params[i]);
}
H.send(p);
}
onload=function(){
request('?',function(){},{'control':'1'});
}
</script>
</head>
<body style='topmargin:25'>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor='#ffffff'>
<tr>
<td>
<? require_once("cabecera.php");?>
</td>
</tr>
<tr>
<td class='bordenaranja' valign='top'>
<?
require_once("ingreso.php");
?>
</td>
</tr>
<tr>
<td valign='top' bgcolor='#006699'>
<? require_once("pies.php");?>
</td>
</tr>
</table>
</body>
</html>