Welcome Guest, Not a member yet? Register   Sign In
Site not working problem on server

Hi Guys

I have completed my website on my local server and have uploaded it to the remote server. Whenever I request the index page of my controller I get a blank page. Whereas if I request another method of the controller it loads perfectly fine. Does anyone know whats going wrong ?
I have changed the base_url() and all the DB configurations.

Do You use mod rewrite ? If so, try without, else post Your controller code.

Well, my local server uses mod rewrite. Enabled or disabled, the site loads fine. The shared server doesn't load the page at all. Im really lost here. Code below:

class Home extends Controller {

    function index() {
    function profile() {

The index function doesn't load whereas the profile function loads the relevant data.

Ok, the problem has been discovered. Its the following line of code on the html:

<?xml version="1.0" encoding="utf-8"?>

I am guessing the <? ?> brackets are causing some sort of error since the file is labelled with a .php extension. Anyone know how I can fix this?

Your hoster could disable it for You, it's the PHP config variable short_open_tag.

Echo it in a php statement between single quotes and you'll be fine. That way it will not be interpreted as PHP code.
echo '<?xml version="1.0" encoding="utf-8"?>';

Where exactly can I find the file with the xml-line?
Thx, Spot

For slightly confusing fix Smile

<?='<?xml version="1.0" encoding="utf-8"?>'?>

I ran into the same sort of problem when I tried to load a view that was XML with PHP mix-ins for use in a custom payment module.

Just a note, PHP short tags like Brian posted will be deprecated, and are not recommended for use. The standard <?php echo 'something'; ?> should be used if you're concerned about longevity.

Theme © iAndrew 2016 - Forum software by © MyBB