beuh Alex
06-18-2009, 08:05 AM
Hi,
I am trying to set up a mobile phone redirect. I am using http://detectmobilebrowsers.mobi/ script as it is usually very easy to use and very reliable. In my index page I have the following script:
<?php
include('mobile_device_detect.php');
mobile_device_detect(true,true,true,true,true,true ,'http://wikipedia.org',false);
?>
The header change is being made in the mobile_device_detect.php, but the error I'm getting isn't stemming from there. I am receiving the following error:
Warning: Cannot modify header information - headers already sent by (output started at /home5/canadaw2/public_html/canadawideflowers/index.php:1)
This would mean that there is output on the very first line of my index.php file that is blocking the header change further on. I have checked and double checked and triple checked, there is absolutely nothing before the php code above in my index.php file. I even emptied the entire file out and wrote only the following line:
<?php header('Location: http://www.example.com/'); ?>
With absolutely nothing before it, just that one line and nothing else, it still returned the error:
Warning: Cannot modify header information - headers already sent by (output started at /home5/canadaw2/public_html/canadawideflowers/index.php:1)
I am really confused... I have worked with php for a long time now and I have used this kind of code many times before. I know that it has to be placed before any output is done.
The website can be found at:
http://66.147.247.237/canadawideflowers/index.php
When I put the exact same code at the very top of my search page:
http://66.147.247.237/canadawideflowers/search.php
It works perfectly without giving me any of the errors. This is how I know that I'm completely crazy and that there is in fact no data before the php code.
It also leads me to believe that it might be because I have not yet transferred the domain that is going to be used. I am wondering if maybe bluehost is doing some kind of redirect of it's own and in the process is outputting some html? Why would it work perfectly on the search page and not on the index page? Is this a bluehost issue? Is it being cause because I haven't transferred a domain yet?
I am trying to set up a mobile phone redirect. I am using http://detectmobilebrowsers.mobi/ script as it is usually very easy to use and very reliable. In my index page I have the following script:
<?php
include('mobile_device_detect.php');
mobile_device_detect(true,true,true,true,true,true ,'http://wikipedia.org',false);
?>
The header change is being made in the mobile_device_detect.php, but the error I'm getting isn't stemming from there. I am receiving the following error:
Warning: Cannot modify header information - headers already sent by (output started at /home5/canadaw2/public_html/canadawideflowers/index.php:1)
This would mean that there is output on the very first line of my index.php file that is blocking the header change further on. I have checked and double checked and triple checked, there is absolutely nothing before the php code above in my index.php file. I even emptied the entire file out and wrote only the following line:
<?php header('Location: http://www.example.com/'); ?>
With absolutely nothing before it, just that one line and nothing else, it still returned the error:
Warning: Cannot modify header information - headers already sent by (output started at /home5/canadaw2/public_html/canadawideflowers/index.php:1)
I am really confused... I have worked with php for a long time now and I have used this kind of code many times before. I know that it has to be placed before any output is done.
The website can be found at:
http://66.147.247.237/canadawideflowers/index.php
When I put the exact same code at the very top of my search page:
http://66.147.247.237/canadawideflowers/search.php
It works perfectly without giving me any of the errors. This is how I know that I'm completely crazy and that there is in fact no data before the php code.
It also leads me to believe that it might be because I have not yet transferred the domain that is going to be used. I am wondering if maybe bluehost is doing some kind of redirect of it's own and in the process is outputting some html? Why would it work perfectly on the search page and not on the index page? Is this a bluehost issue? Is it being cause because I haven't transferred a domain yet?