My redirect still don't working right
Hello everybody
Few days ago I ask why my page don't redirect to other one.
User sdi126 tell me that Header function's syntax was wrong.
That was true, but I found sometime interesting
This is my complete code, I create a file named Bases.php, this is a class to access a database, here is it
Bases.php
<?php
class Base{
var $Host;
var $Usuario;
var $Clave;
var $DB;
var $Ors;
var $Coneccion;
function Base($Host,$Usuario,$Clave,$DB) {
$this->Host = $Host;
$this->Usuario = $Usuario;
$this->Clave = $Clave;
$this->DB = $DB;
}
function AbrirDB(){
if (!($this->Coneccion=mysql_connect($this->Host, $this->Usuario, $this->Clave))){
//echo ("<P> No se puede conectar a la BD <BR>");
exit();
}
if (!mysql_select_db($this->DB)) {
//echo ("<P>No se puede seleccionar la BD<BR>");
exit();
}
}
function &execute($sql){
if(!($this->Ors = mysql_query($sql))){
// echo "No se puede ejecutar el sql <p>";
return FALSE;
}
return TRUE;
}
function &fetch(){
return mysql_fetch_array($this->Ors);
}
function &row(){
return mysql_num_rows($this->Ors);
}
function &CerrarDB(){
if (mysql_close($this->Coneccion))
return TRUE;
return FALSE;
}
}
?>
And here is the page where I Include Bases.php
Incluir.php
<?php
include ("./Include/Bases.php");
require './Include/Configuracion.ini';
extract($_GET);
extract($_POST);
//echo "<PRE> GET :";print_r($_GET);echo "POST :";print_r($_POST);echo "</PRE>";
$base = new Base($Host,$Usuario,$Clave,$BD);
$base->AbrirDB();
if (isset($_POST["Accion"])){
if($Accion=="Agregar"){
$DirArchivo=$_FILES["TxtArchivo"]["name"];
$Sql= "INSERT INTO TableroCorreos (Contacto,Email,Adjunto,Observaciones,Procesado) Values('$TxtContacto','$TxtCorreo','$DirArchivo',' TxtNota',0)";
$base->execute($Sql);
$Accion='';
}
}
$base->CerrarDB();
header('Location: 192.168.1.100/UtilitarioCorreos.php');
?>
And Here is the interesting:
This page don't redirect, but if I don't include the Bases.php file and I comment out the lines which use the functions in this file, my page redirect correctly.
I'm still looking for a explanation.
Someone would can Help me????
Since now Thank's
|