View Single Post
  #1 (permalink)  
Old August 24th, 2007, 04:20 PM
ludigova ludigova is offline
Registered User
 
Join Date: Aug 2007
Location: San Rafeael, Heredia, Costa Rica.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to redirect a web page

http://p2p.wrox.com/forum.asp?FORUM_ID=92



Hello

I'm new in this forum

I need some help

I' ve created a php page, this have a form with method="post" and I get some error when someone press F5 key

So, I create a new page with the php code needed when submit, then in this page i use header to redirect to the first page, but it doesn't work

Here are the to codes

UtilitariCorreos.php
<FORM ENCTYPE="multipart/form-data" action="Incluir.php" name="FrmCorreos" method="post">
        <table width="77%"border="1" align="center" bgcolor="ffffff">
            <tr><td>
                <table border="0" cellpadding="0" cellspacing="0" width="100%" align="center" style="color:#000000;">
                    <tr>
                      <td width="25%"><strong>Contacto</strong></td>
                        <td width="75%" align="left"><input name="TxtContacto" type="text" class="Estilo1" size="50%" maxlength="50"></td>
                    </tr>
                    <tr>
                        <td width="25%"><strong>Correo Electr&oacute;nico</strong></td>
                        <td align="left"><input name="TxtCorreo" type="text" class="Estilo1" size="80%" maxlength="200"></td>
                    </tr>
                    <tr>
                        <td width="25%"><strong>Archivo</strong></td>
                        <td align="left"><input name="TxtArchivo" type="file" class="Estilo1" size="80%" maxlength="200"></td>
                    </tr>
                    <tr>
                        <td width="25%"><strong>Envio</strong></td>
                        <td align="left">
                            Informaci&oacute;n Comercial<input name="TxtEnvioIC" type="checkbox" class="Estilo1">
                            Archivo<input name="TxtEnvioAr" type="checkbox" class="Estilo1">
                        </td>
                    </tr>
                    <tr>
                          <td width="25%"><strong>Observaciones</strong></td>
                          <td align="left"><textarea name="TxtNota" cols="80%" class="Estilo1"></textarea></td>
                    </tr>
                    <tr>
                        <td colspan="2" align="right"><input type="submit" name="Accion" value="Agregar"></td>
                    </tr>
                </table>
            </td></tr>
        </table>

    </FORM>


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("192.168.1.100/UtilitarioCorreos.php");// Here is the error
?>

Everything is right, just the header line is wrong

if someone can help me i'll be so glad.

PD: sorry i not good with English.