Welcome Guest, Not a member yet? Register   Sign In
blank screen on CI
#11

[eluser]InsiteFX[/eluser]
Maybe you should add the HTML DocType to your html page.

Code:
<!DOCTYPE html>
&lt;html lang="en"&gt;

&lt;head&gt;

&lt;/head&gt;

&lt;body&gt;

&lt;/body&gt;

&lt;/html&gt;
#12

[eluser]davy_yg[/eluser]
ok, I add this at the top of

views/homepage.php

Code:
&lt;?php die('test1'); ?&gt;

<!DOCTYPE html>
&lt;html lang="en"&gt;

controllers/page.php

Code:
&lt;?php

class Page extends CI_Controller {

    public function index()
    {
    echo "Controller loaded";
$this->load->view('homepage');
    }

}

?&gt;


I receive this result:

Controller loadedtest1


I wonder why all the codes in html does not work.
#13

[eluser]LuckyFella73[/eluser]
For me it sounds like you have an php error in your view while your server
supresses them to be displayed.

Do you have this setting in your index.php (root directory):
Code:
define('ENVIRONMENT', 'development'); // to set: error_reporting(E_ALL);

and this in application/your config/config.php ?
Code:
$config['log_threshold'] = 1;
#14

[eluser]davy_yg[/eluser]
Do you have this setting in your index.php (root directory): - yes

define('ENVIRONMENT', 'development'); // to set: error_reporting(E_ALL);

and this in application/your config/config.php ? - yes

but not: $config['log_threshold'] = 1;

I have this: $config['log_threshold'] = 0;
#15

[eluser]LuckyFella73[/eluser]
Try setting the $config[‘log_threshold’] = 1; and have a look at the
log file in "applications/logs/ xxx ".

If you don't find any halpfull information there I would do this:
- backup your view file (renamed)
- start with an empty view file and put only plain HTML in it for the beginning
- add the PHP parts from your backup step by step and reload your page after each new PHP block.

That way you should get the part that produces the error.
#16

[eluser]davy_yg[/eluser]

I don't think the css loads correctly. I have this:

Code:
body{background-image1:url('../images/indonusa3.jpg'); background-repeat: repeat-x; background-position: center top; height: 800px;}

I do not see the background image loads.
#17

[eluser]LuckyFella73[/eluser]
When setting background images via inline css you'll have to provide the
full path to the images. Use base_url('assets/images/image.jpg') according to your
file structure.

Code:
$('body').css('background-image', 'url("&lt;?php echo base_url('assets/images/indonusa3.jpg'); ?&gt;")');
#18

[eluser]davy_yg[/eluser]
It' still doesn't loads correctly. These are the whole codes:

views/homepage.php

Code:
<!DOCTYPE html>
&lt;html lang="en"&gt;

&lt;head&gt;
&lt;link href= "&lt;?php echo base_url('assets/css/style.css'); ?&gt;" rel="stylesheet" type="text/css" media="screen"&gt;
&lt;/head&gt;

&lt;body&gt;


TEST
&lt;/body&gt;

&lt;/html&gt;


assets/css/style.css

Code:
$('body').css('background-image', 'url("&lt;?php echo base_url('assets/images/indonusa3.jpg'); ?&gt;")');

RESULT: blank screen

If I turn off the :

&lt;link href= "&lt;?php echo base_url('assets/css/style.css'); ?&gt;" rel="stylesheet" type="text/css" media="screen"&gt;

Then

RESULT: TEST
#19

[eluser]LuckyFella73[/eluser]
What I wrote was meant to be printed inyour view file not css file.
It' jquery so you can't put it into your css.

I took the line from you post:

Code:
// more code before
<div id="slideshow" class="pics">
    [removed]$('body').css('background-color', 'blue');[removed]
    [removed]$('body').css('background-color', 'red');[removed]
    [removed]$('body').css('background-image', 'url("../images/indonusa3.jpg")');[removed] // THIS LINE
    </div>
// more code after

But you have to edit the image path - or did you save your image (indonusa3.jpg) in "YOUR_PROJECT_FOLDER/assets/images/" ?
#20

[eluser]davy_yg[/eluser]
Well, there are already too much codes in it if I insert the whole code up to the css in the view files.

I simply trying to insert the php code one by one beginning from inserting the stylesheet:

views/homepage.php
Code:
&lt;link href= "&lt;?php echo base_url('assets/css/style.css'); ?&gt;" rel="stylesheet" type="text/css" media="screen"&gt;

So my stylesheet css code remains correct right?

assets/css/style.css
Code:
body{background-image1:url('../images/indonusa3.jpg'); background-repeat: repeat-x; background-position: center top; height: 800px;}

yes, I do have assets/images/indonusa3.jpg

I wonder eventhough I only loads those codes in those files, why the background doesn't appears ?




Theme © iAndrew 2016 - Forum software by © MyBB