Bob,
To redirect I use a simple little function which doesn`t need URLEncode and
works thru  Apache without drama although it is a bit of a "cheat" since it
is sending a small chunk of client side script...


function redirect($url){
echo "<script>window.location.replace(\"".$url."\")</script>";
}

(put this near the top of your code or stick it in an "included" library of
frequently used functions)


in your PHP code you would use it thus ...

if ($_POST["txtPassword"] == "" ) {
redirect("logon.php?params=".$params."&info=I need a password");
}

There are undoubtedly several good reasons why a purist wouldn`t do it that
way but hey - it works.


Cheers  CD




----- Original Message -----
From: "BOb Pardoe" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, October 19, 2002 2:11 AM
Subject: [PHP-WIN] IIS \ Apache and header(location: errors


> I am trying to execute the following redirection on a web page if the
error
> condition is true
>
> if ($_POST["txtPassword"] == "" ) {
>  header ("Location :
>
http://".$_SERVER["HTTP_HOST"].dirname($_SERVER["PHP_SELF"])."/"."errors.php
>
?Err=".URLEncode("LogOn -002")."&SrcLocn=".URLEncode("LogOn.php")."&Info=".U
> RLEncode("The Password Cannot Be
> Empty")."&RtnTo=".URLEncode("LogOn.php")."&Params=".URLEncode($Params));
>  exit;
> }
>
> The text resolves to
>
>
http://localhost/public/errors.php?Err=LogOn+-+002&SrcLocn=LogOn.php&Info=Th
> e+Password+Cannot+Be+Empty&RtnTo=LogOn.php&Params=
>
> which is correct.
>
> I am running on XP SP1
>
> My problem is that this works fine on IIS 5.0 but fails on Apache 1.3.26
and
> Apache 2.0.39
>
> No errors are logged in php, apache or event logs.
>
> I just get a blank page, viewing this source it is the index.php page (the
> frameset definitions)
>
> Ideas ?
>
> Any help appreciated.
>
> Thanks
>
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to