Jump to content

code working on localhost but not work on hosting


gongpex

Recommended Posts

Hello everyone,

 

have simple codeigniter code :

function example($id) {   if(empty($id)) {          redirect(base_url('index.php/example'));   } }

this code $id is empty it will redirect automatically on page that determined.

 

This work on localhost, but after I uploaded on hosting this code didn't work it will show :

Missing argument 1 for Example::example()

and

Cannot modify header information - headers already sent by (output started at /srv/disk2/602761/www/example.com/system/core/Exceptions.php:189) 

I had ask to my hosting and they answer to me this probably because they prohibits me to use .htaccess because my hosting is free.

 

Q :Is that true?

 

please answer

 

Thanks

Link to comment
Share on other sites

First, you called a function without passing in the argument.

 

Secondly, you tried to send a header after having printed out content. All headers must be sent before any HTML or any echo statements.

 

.htaccess isn't related to the error messages you are getting.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...