Re: [PHP] redirect with header still not working
Thanks all I manged to fix it. The headers were already sent by a validation class I was using and needed a bit of output buffering to get it working. R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] redirect with header still not working
Can you re-iterate what is happening - I have a site with 1and1 and use header() with no issues.
Re: [PHP] redirect with header still not working
That is, unless you use output buffering. It may not be the most elegant solution (using header() to redirect users increases server calls), but I built a template-driven php site that calls: ?php ob_start; ? ...depending on certain conditions which means I can then use header() even after I have started output.
RE: [PHP] redirect with header still not working
Have tried the full url for the header and it still doesn't work. I may have to resort to...javacript redirects unless someone can suggest a way around it. Here is the phpinfo(); http://s202801613.websitehome.co.uk/info.php Is is 1and1 hosting if anyone had had any experience of them. thanks, R. I have several sites with 1and1, and I use header() with no problems. The main issue I have run into with header() is that your script can produce NO OUTPUT prior to the header() call. Not even a whitespace, else header() will not work. JM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] redirect with header still not working
Ross wrote: Right, Have tried the full url for the header and it still doesn't work. I may have to resort to...javacript redirects unless someone can suggest a way around it. Here is the phpinfo(); http://s202801613.websitehome.co.uk/info.php Is is 1and1 hosting if anyone had had any experience of them. thanks, R. if you look at your error_report setting. is it 2037 somebody correct me if I am wrong, but isn't this setting I ran this on my older system and found that (E_ALL ~E_NOTICE ~E_WARNING) all together = 2037 so, even though you have display_errors turned on, it isn't going to show them. you need to set this to just E_ALL ?php error_reporting(E_ALL); ... ? This should solve your problem -- Enjoy, Jim Lucas Different eyes see different things. Different hearts beat on different strings. But there are times for you and me when all such things agree. - Rush -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] redirect with header still not working
Ross wrote: Right, Have tried the full url for the header and it still doesn't work. I may have to resort to...javacript redirects unless someone can suggest a way around it. Here is the phpinfo(); http://s202801613.websitehome.co.uk/info.php Is is 1and1 hosting if anyone had had any experience of them. thanks, R. actually, let me re-state that, it will then display the error that is being generated. It won't fix it, but at least display it to you. It will probably complain about output in a given file somewhere before you are calling header(...) it will give you the line number that the output is being generated on. -- Enjoy, Jim Lucas Different eyes see different things. Different hearts beat on different strings. But there are times for you and me when all such things agree. - Rush -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] redirect with header still not working
Ross wrote: Have tried the full url for the header and it still doesn't work. I forget what your exact issue is, but a good first step to take when debugging a problem with header() is to replace it with echo. For example: echo Location: $url; Instead of: header(Location: $url); Almost every problem I can recall someone having with header() was a result of either: 1. Headers already being sent, as others have guessed. 2. The argument passed to header() being malformed, and the browser doesn't interpret the malformed header as desired. Hope that helps. Chris -- Chris Shiflett http://shiflett.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] redirect with header still not working
On Tue, April 17, 2007 10:02 am, Ross wrote: Right, Have tried the full url for the header and it still doesn't work. I may have to resort to...javacript redirects unless someone can suggest a way around it. Here is the phpinfo(); http://s202801613.websitehome.co.uk/info.php Is is 1and1 hosting if anyone had had any experience of them. This site is hosted on 1and1.com and DEFINTELY does a header redirect: http://telephonebook.com/ In fact, that's pretty much *all* the site does :-) It's like a tinyURL for your phone number to your blog thingie. Ignore the ugliness, please. We've got new artwork going up shortly. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php