[Scottish] problems with php header function with my ISP

george scottish at mailman.lug.org.uk
Sun Apr 27 15:46:01 2003

       Let that be a lesson to me, that I must not read/reply to emails 
when in a hurry to go somewhere.
Anyway what Ray says is right, if you are passing your variables through 
a querystring $_GET or through a form using the POST method $_POST then 
you can only access these varibales by using
$_GET["varname"] or $_POST["varname"]

or if you want $_ENV["varname"] for either

anyway it's a good idea to reassign these variables from within your 
script. So you could add this to the top of your script

  $quizname = $_GET["quizname"]; //assuming we are using tge GET method


george wrote:
> Hi Tam,
>         You say your ISP has PHP installed as a CGI instead of an 
> Apache/ISAPI module. Is it a windoze box or Linux? These errors have 
> been haunting the Win32 stability of PHP. Please try the following.
>  If you have opened a connection to the databse then close it as soon as 
> possible, ie before you use the header() function.
> Turn implicit_flush = on in your php.ini files (Although I doubt you 
> will have access to your ISP's ini file)
> Finally could you echo "\n\n"; immediately after your header() call
> You can find out more information on this bug at
> http://bugs.php.net/bug.php?id=9852
> -- 
> George
>  Co-author: Foundation Dreamweaver MX
>  Co-author: Dreamweaver Mx: Advanced Php Web Development
>  Co-author: Web Development on Mac OSX
> Tam McLaughlin wrote:
>> Hi,
>> I seem to have a problem with the header function working under my ISP 
>> force9's config. The code works fine on my apache/php config at work 
>> and also on my home PC but when I put the php files on my ISPs cgi 
>> server I get the error msg specified within the die function and it 
>> does not redirect.
>> I tried writing a simple php program with only the line below which 
>> worked fine on the F9 cgi server (well ok, it took me to the correct 
>> URL but the variables were obviously not set). The weird thing was, 
>> earlier today, I was getting the error when using konqueror but it 
>> worked ok under mozilla.
>> Now I just tried it under mozilla and I got the error msg. I am sure 
>> my code is ok i.e I am not sending any output to the browser before 
>> the header and it does work  under my local config.
>> I have tried using a relative path name and also the absolute URL. The 
>> rest of the program works ok and if I access the php program I am 
>> trying to redirect to
>> it work fine.
>> The code is:
>> header ("Location:  
>> http://cgi.tammclaughlin.force9.co.uk/cgi-bin/question_type.php?question=1&quizname=$quizname") 
>> or die ("Can't go to location ");
>> Any ideas?
>> Thanks.
>> _______________________________________________
>> Scottish mailing list
>> Scottish@mailman.lug.org.uk
>> http://mailman.lug.org.uk/mailman/listinfo/scottish
> _______________________________________________
> Scottish mailing list
> Scottish@mailman.lug.org.uk
> http://mailman.lug.org.uk/mailman/listinfo/scottish