Welcome Guest, Not a member yet? Register   Sign In
Blank white page
#1

[eluser]darrenfauth[/eluser]
I've been through all the posts I can find regarding getting blank white pages...but still unable to track down my issue. All pages of this site worked fine on my localhost (PHP 5.2.1). On the live server it is not. (PHP 4.4.9)

The root page of my site displays fine: http://onebadwheel.com
It is a simple action (and the default in my routes) that displays 3 views: header, home, footer with no dynamic data.

Code:
class Home extends Controller {

    function Home()
    {
        parent::Controller();    
    }
    
    function index()
    {
         // send to view
          $data['page_title'] = 'NASCAR Onebadwheel';
          $this->load->view('header', $data);
          $this->load->view('home');
          $this->load->view('footer');
    }
}

The page I am getting a blank white page is: http://onebadwheel.com/articles/

It should display an unordered list of linked article titles

Code:
class Articles extends Controller {

    function Articles()
    {
        parent::Controller();    
    }
    
    function index()
    {
        $this->load->model('article_model');
        // get article titles
        
        $data['rows'] = $this->article_model->getArticles();
        
        $data['page_title'] = 'NASCAR Onebadwheel Articles';
          
          //is data being created?
          echo '<pre>'.print_r($data, true) . '</pre>';
          
          $this->load->view('header', $data);
          $this->load->view('articles');
          $this->load->view('footer');
    }

My article_model is returning data evidenced by the print_r printing the array to the page.

The 3 views being passed are identical and well formed html as the home page:

Here is the articles view that should display the list of articles.

Code:
<div class="span-24 last">
<h1>NASCAR 101 Articles</h1>    
<ul>
        &lt;?php foreach($rows as $r) : ?&gt;
        
        &lt;?php $url = strtolower(str_replace(' ', '-', $r->title));?&gt;
        
        <li><a >id;?&gt;/&lt;?php echo $url;?&gt;">&lt;?php echo $r->title; ?&gt;</a></li>
        
        &lt;?php endforeach; ?&gt;
</ul>
</div>

(* the rest of the a tag and some of the url is not showing up in this post...but it is there)

I've got another function on the articles controller that will not display as well. Only the home page..nothing deeper. I've got my .htaccess set up to eliminate the index.php in the url.

Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>


Any thoughts? I sure appreciate it.
#2

[eluser]darrenfauth[/eluser]
Hmmmm...things are strange here. I need to look into a few other things it seems.

The other action on my articles controller is this:

Code:
function view($id=null)
    {
        // get parameters from url
        $id = $this->uri->segment(2);
        
        $this->load->model('article_model');
        // get article
        $data['rows'] = $this->article_model->getArticle($id);
        $data['page_title'] = 'NASCAR Onebadwheel Articles';
          $this->load->view('header', $data);
          $this->load->view('article');
          $this->load->view('footer');
        
        
    }

With error reporting in my root/index.php file set like this:

Code:
error_reporting(E_ALL);
ini_set('display_errors',TRUE);

I'm now seeing this error:
Fatal error: Call to a member function on a non-object in /var/www/vhosts/onebadwheel.com/httpdocs/system/application/controllers/articles.php on line 34

which is this line: $data['rows'] = $this->article_model->getArticle($id);

When I completely remove that whole action (function view($id=null) {....) I get the home pages view showing up where my article list should be. Strange.

Do i maybe need to do something in my routes?

Am I correct in thinking that: mydomain.com/articles should automatically show the index action on the articles controller?
#3

[eluser]darrenfauth[/eluser]
For what it's worth...I'll keep replying to my own thread Tongue

When running PHP4 (like I am) 'view' is a reserved word, so i can't use it for the action in my controller and probably why it was throwing an error. I have changed it and no more error.

I am now also seeing the top portion of this page view and then it pukes out where it should be foreach'ing through my data...
#4

[eluser]darrenfauth[/eluser]
Ha...I'll close out my thread now. Problem is solved by not using the reserved word view as an action in my controller.

Least I learned some more about error_reporting and reserved words.

Thanks for indulging my monologue.
#5

[eluser]John_Betong[/eluser]
[quote author="darrenfauth" date="1250925936"]Ha...I'll close out my thread now. Problem is solved by not using the reserved word view as an action in my controller.

Least I learned some more about error_reporting and reserved words.

Thanks for indulging my monologue.[/quote]
&nbsp;
This thread has made me chuckle especially since I checked your site and it came up with this:
Quote:Forbidden

You don't have permission to access / on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle
the request.
&nbsp;
I am pleased you managed to solve yor problem.
&nbsp;
&nbsp;
&nbsp;
#6

[eluser]darrenfauth[/eluser]
What?!?

Now I got something else to debug?

Seriously though...you got that when going to the url for my personal site? You type it right in your browser or click on the 'fantasy name generator' on the nascar site?
#7

[eluser]John_Betong[/eluser]
&nbsp;

http://www.darrenfauth.com/
&nbsp;
This is the link that is giving the Forbidden: 403 error.
&nbsp;
maybe also have a look at your webstats and access logs.
&nbsp;
&nbsp;
&nbsp;
edit: added screen dump, etc
#8

[eluser]darrenfauth[/eluser]
John-

wow...that's crazy. Works fine from every computer I've ever tried it from. I'll check on other connections via friends and see what they get.

How about a deeper link?

http://www.darrenfauth.com/calculators/m...ng-smoking

Thanks!

Darren
#9

[eluser]John_Betong[/eluser]
[quote author="darrenfauth" date="1250929118"]John-

wow...that's crazy. Works fine from every computer I've ever tried it from. I'll check on other connections via friends and see what they get.

How about a deeper link?

http://www.darrenfauth.com/calculators/m...ng-smoking

Thanks!

Darren[/quote]
&nbsp;
Your supplied link gives the same error.
&nbsp;
Try:
1. renaming your .htaccess file.
2. creating index.htm
3. creating index.html
4. creating darren.php
5. creating darren.htm
6. creating darren.html
&nbsp;
&nbsp;
&nbsp;
#10

[eluser]InsiteFX[/eluser]
As far as your original problem.

Code:
<div class="span-24 last">
<h1>NASCAR 101 Articles</h1>    
<ul>
        &lt;?php foreach($rows as $r) : ?&gt;
        
        &lt;?php $url = strtolower(str_replace(' ', '-', $r->title));?&gt;
        
        <li><a >id;?&gt;/&lt;?php echo $url;?&gt;">&lt;?php echo $r->title; ?&gt;</a></li>
        
        &lt;?php endforeach; ?&gt;
</ul>
</div>

Look at this line of code:

Code:
<li><a >id;?&gt;/&lt;?php echo $url;?&gt;">&lt;?php echo $r->title; ?&gt;</a></li>

After the <a > you have id;?&gt; then after the next one you have ?&gt;">

Enjoy
InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB