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



[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



Re: [PHP] Redirect not working on server

2009-06-02 Thread revDAVE
I found the answer here - I had --- whitespace  ... if ?php is at line 2

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 ?php is at line 2 of your script and a blank line is above it then that
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



--
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 Shawn McKenzie
revDAVE wrote:
 I found the answer here - I had --- whitespace  ... if ?php is at line 2
 
 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 ?php is at line 2 of your script and a blank line is above it then that
 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 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 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