Question

everything works fine until i upload my files into server and server have problems with my base_url.

Try a lot of things, but nothing helps.

now code it is:

$config['base_url']    = '';

also was:

$config['base_url']    = ‘http://’.$_SERVER['HTTP_HOST']) and mores

server name is: http://rude.su.lt/~grinius/svetaine/

rude.su.lt - hostname grinius- my username svetaine-my web folder

database.php has code:

$db['default']['hostname'] = 'rude.su.lt';
$db['default']['username'] = 'grinius';
$db['default']['password'] = '***********';
$db['default']['database'] = 'grinius_database';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;

view of my web now is: http://postimg.org/image/aj03o96jb/

also then I click on some text i have 404 Not found Error

My code of left column:

<? 
 if (!$_SESSION || !$_SESSION['username']) { 
$this->load->helper('form');
echo form_open(base_url() . 'login');
?>
<strong>Iveskite savo duomenis</strong>
<br /><br />
Vartotojas:<br />
<?
echo form_input('username');
?>
<br />Slaptazodis:<br />
<?
echo form_password('password');
?>
<br /><br />
<?
echo form_submit('submit', ' Log in ');
echo form_close();
?>
<br />
<a href="<?php echo base_url(); ?>register">Nauja Registracija</a>
<?
} else {
?>
Welcome, <?=$_SESSION['username'];?>
<br /><br />
<br />
<a href="<?php echo base_url(); ?>profile">Profilis</a>
<br />
<a href="<?php echo base_url(); ?>logout">Atsijungti</a>
<?
} 
?>
Was it helpful?

Solution

Your server config does not support using <? ... ?>. Either change the relevant config on server or use <?php ... ?> and it will be fine.

Edit: Try setting short_open_tag=On in your php.ini.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top