You are here: Re: header (Location: ) not working on web server « PHP Programming Language « IT news, forums, messages
Re: header (Location: ) not working on web server

Posted by Jonathan N. Little on 02/07/07 19:59

php newbie wrote:
> Thanks all for valuable inputs, I will try phpinfo() function tonight.
> What could be the reason for code to be working on my local machine
> and not working on the web server.
>
> Following is the pseudo code of what my php page looks like
>
> ---- temp1.php --------
> <html>
> <head>
>
>
> </head>
> <body>

The "<html><head></head><body> stuff *cannot* be above your header call
that flows...

> <?php
>
> // test if this is postback
> // if this is postback
> // create session and write form fields to the session
> // call header(Location: ) function to redirect to temp2.php page
>
> ?>
>
> <form method="post" action="temp1.php" >
>
> // form input fields
>
> <input type="submit" value="Submit" >
> </form>
> </body>
> </html>


---- temp1.php -------- Should be:

<?php
//do what ever testing you want to determine if you want to redirect
if( $redirect_condition == TRUE ){
//put redirect here
header("Location: http://www.example.com/temp2.php");
}
//if your not redirecting then put your page below
?>
<html>
<head>...



--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация