Re: [PHP] Redirect not working on server

2009-06-03 Thread Ashley Sheridan
On Tue, 2009-06-02 at 20:43 -0700, revDAVE wrote:
> Thank you Jay - Shawn & Paul for helping this newbie!
> 
> 
> --
> Thanks - RevDave
> Cool @ hosting4days . com
> [db-lists 09]
> 
> 
> 
> 
Also, according to the spec, the URL should be in absolute form, not
relative like you have there.


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] Redirect not working on server

2009-06-02 Thread revDAVE
Thank you Jay - Shawn & Paul for helping this newbie!


--
Thanks - RevDave
Cool @ hosting4days . com
[db-lists 09]




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



Re: [PHP] Redirect not working on server

2009-06-02 Thread Paul M Foster
On Tue, Jun 02, 2009 at 11:50:55AM -0700, revDAVE wrote:

> I have this line at the end of 1 big php block...
> 
> header('Location: mypage.php?id=' .
> $_SESSION['id'].'&cat='.$_SESSION['cat']);
> 
> It works fine on my dev. Testing server but does not forward on the actual
> website
> 
> Any way to fix this?
> 
> 
> 
> Home is php 5
> 
> Server (not sure) might not be 5 - maybe v4
> 
> Could that be the problem?
> 

If I ever have a redirect like this, I *always* put after it:

exit();

which ensures it will not do anything else.

Paul

-- 
Paul M. Foster

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



Re: [PHP] Redirect not working on server

2009-06-02 Thread Shawn McKenzie
revDAVE wrote:
> I found the answer here - I had --- whitespace & ... if  
> Location: http://www.phpbuilder.com/board/showthread.php?t=10310794
> 
> Blank space above the php tag or below the final php tag
> It is not intuitive but ...
> 
> if  can cause problems such as the php header function not working.
> 
> 
> =
> 
> 
> *So I just need to get this working... error_reporting(E_ALL);
> 
> If I put this on a page isn't it supposed to override other server setting
> and display errors? It's not - This the page is blank - except for the echo
> test
> 
> 

Yes, but id display_errors = Off then you need to do:
ini_set('display_errors', '1');

-- 
Thanks!
-Shawn
http://www.spidean.com

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



Re: [PHP] Redirect not working on server

2009-06-02 Thread revDAVE
I found the answer here - I had --- whitespace & ... if http://www.phpbuilder.com/board/showthread.php?t=10310794

Blank space above the php tag or below the final php tag
It is not intuitive but ...

if http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Redirect not working on server

2009-06-02 Thread revDAVE
On 6/2/2009 12:41 PM, "revDAVE"  wrote:

>> [snip]
>> I have this line at the end of 1 big php block...
>> 
>> header('Location: mypage.php?id=' .
>> $_SESSION['id'].'&cat='.$_SESSION['cat']);
>> 
>> It works fine on my dev. Testing server but does not forward on the
>> actual
>> website
>> 
>> Any way to fix this?

The error that a tech said he sees on server version is:

cannot send session cook - headers already sent
cannot modify header

- but no errors at my house...


BTW: I found out that Php on server is v5.1.2

--
Thanks - RevDave
Cool @ hosting4days . com
[db-lists 09]




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



Re: [PHP] Redirect not working on server

2009-06-02 Thread revDAVE
On 6/2/2009 12:04 PM, "Jay Blanchard"  wrote:

> [snip]
> I have this line at the end of 1 big php block...
> 
> header('Location: mypage.php?id=' .
> $_SESSION['id'].'&cat='.$_SESSION['cat']);
> 
> It works fine on my dev. Testing server but does not forward on the
> actual
> website
> 
> Any way to fix this?
> [/snip]
> 
> The first thing that you will want to do is
> 
> echo $_SESSION['id'];
> echo $_SESSION['cat'];
> 
> To see if they contain anything

THANK YOU JAY,

BTW: I'm a newbie

They seem to be fine - and have proper content

I added this:

error_reporting(E_ALL);

If I put this on a page isn't it supposed to override other server setting
and display errors? It's not - This the page is blank - except for the echo
test


BTW: I found out that Php on server is v5.1.2






--
Thanks - RevDave
Cool @ hosting4days . com
[db-lists 09]




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



RE: [PHP] Redirect not working on server

2009-06-02 Thread Jay Blanchard
[snip]
I have this line at the end of 1 big php block...

header('Location: mypage.php?id=' .
$_SESSION['id'].'&cat='.$_SESSION['cat']);

It works fine on my dev. Testing server but does not forward on the
actual
website

Any way to fix this?
[/snip]

The first thing that you will want to do is

echo $_SESSION['id'];
echo $_SESSION['cat'];

To see if they contain anything

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



[PHP] Redirect not working on server

2009-06-02 Thread revDAVE
I have this line at the end of 1 big php block...

header('Location: mypage.php?id=' .
$_SESSION['id'].'&cat='.$_SESSION['cat']);

It works fine on my dev. Testing server but does not forward on the actual
website

Any way to fix this?



Home is php 5

Server (not sure) might not be 5 - maybe v4

Could that be the problem?


--
Thanks - RevDave
Cool @ hosting4days . com
[db-lists 09]




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