Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
| Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 24th, 2007, 04:20 PM
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.

  #2 (permalink)  
Old September 4th, 2007, 02:54 PM
Authorized User
 
Join Date: Sep 2007
Location: , , .
Posts: 56
Thanks: 0
Thanked 1 Time in 1 Post
Default

Your missing the keyword location

header('Location: 192.168.1.100/UtilitarioCorreos.php');

http://mynameissteve.com


Similar Threads
Thread Thread Starter Forum Replies Last Post
Page redirect help jroxit Classic ASP Basics 7 August 11th, 2008 11:01 AM
Redirect all pages of my web application Maxxim ASP.NET 1.0 and 1.1 Professional 16 May 23rd, 2007 11:05 AM
redirect to page other than default page sarah lee ASP.NET 1.0 and 1.1 Basics 3 December 15th, 2006 05:45 PM
Redirect to new page without closing current page peter2004 ASP.NET 2.0 Basics 5 June 5th, 2006 08:49 PM
Redirect page Warbird Classic ASP Basics 4 June 20th, 2003 07:51 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.