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

[eluser]HooJee[/eluser]
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.
#2

[eluser]tomcode[/eluser]
Do You use mod rewrite ? If so, try without, else post Your controller code.
#3

[eluser]HooJee[/eluser]
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:

Code:
class Home extends Controller {

    function index() {
        $this->load->view('homeview');
    }
    
    function profile() {
        $this->load->view('ajax/profile');
    }
    
}

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

[eluser]HooJee[/eluser]
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?
#5

[eluser]tomcode[/eluser]
Your hoster could disable it for You, it's the PHP config variable short_open_tag.
#6

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

[eluser]Unknown[/eluser]
Where exactly can I find the file with the xml-line?
Thx, Spot
#8

[eluser]BrianDHall[/eluser]
For slightly confusing fix Smile

Code:
<?='<?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.
#9

[eluser]Aken[/eluser]
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