Welcome Guest, Not a member yet? Register   Sign In
Problem in view page details
#1

[eluser]rash[/eluser]
Hello all,

I am new in mvc format of php. I want to know that why my index page of the project folder is displayed blank.

Controller code of the index is:

<?php

class Index extends Controller {

function __construct() {
parent::__construct();
}

function index() {
$this->view->uploadlist = $this->model->uploadList();
$this->view->otherlist = $this->model->uploadotherList();
$this->view->render('index/index');
}
}


-----------------------

and model code for index page is:

<?php

class Index_Model extends Model
{
public function __construct()
{
parent::__construct();
}

public function uploadList(){
return $this->db->select('SELECT * FROM slide_content');
}

public function uploadotherList(){
return $this->db->select('SELECT * FROM slide_other ORDER BY slide_other_id ASC LIMIT 1');
}

}

----------

And view code for index is:

<div class="panel">
<div id="featured_slide">
<div id="slider">
<ul id="categories">
&lt;?php
foreach($this->uploadlist as $key => $value) {
?&gt;
<li class="category">
<h2>&lt;?php echo $value['sheading']; ?&gt;</h2>
<a href="&lt;?php echo $value['slink'];?&gt;"><img src="&lt;?php echo URL; ?&gt;public/images/fslider/&lt;?php echo $value['simage'];?&gt;" alt="" /></a>
<p>&lt;?php echo $value['scontent']; ?&gt;</p>
<p class="readmore"><a href="&lt;?php echo $value['page_link'];?&gt;">Read More &raquo;</a></p>
</li>
&lt;?php } ?&gt;
<li class="category">
<h2>&lt;?php echo $this->otherlist[0]['oheading']; ?&gt;</h2>
<a href="&lt;?php echo $this-&gt;otherlist[0]['olink']; ?&gt;"><img src="&lt;?php echo URL; ?&gt;public/images/others/&lt;?php echo $this-&gt;otherlist[0]['oimage']; ?&gt;" alt="" /></a>
<p>&lt;?php echo $this->otherlist[0]['ocontent']; ?&gt;</p>
<p class="readmore"><a href="&lt;?php echo URL;?&gt;others">Read More &raquo;</a></p>
</li>
</ul>
<a class="prev disabled"></a> <a class="next disabled"></a>
<div ></div>
</div>
</div>
</div>

In this When i type "http://localhost/Prameya_mvc/" like this it will show the blank page, but if i type"http://localhost/Prameya_mvc/index" like this it will show the correct page.....

Plz can anyone help me to solve this proble, i didn't understand why it causes....but i want when i type "http://localhost/Prameya_mvc/" it will show the correct page not blank...

Thanks for any suggetion...

#2

[eluser]TheFuzzy0ne[/eluser]
Do you have an .htaccess file to redirect all of your URL arguments through your index.php?

Are you running XAMPP on Windows? If so, you might find it difficult to create an .htaccess file, since Windows will assume .htaccess is a file extension, and that you haven't specified a file name.

Also, while you are developing, try putting the following at the top of your index.php file.

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

Just remember to remove it before your site goes live.

#3

[eluser]rash[/eluser]
k thank u. got it...




Theme © iAndrew 2016 - Forum software by © MyBB