PHP beginner

Hello, I am learning PHP and beginning with some CodeIgniter example, but I get an error that page is not found

CONTROLLER
[php] function index() {
$this->load->model(‘Grades_model’);
$data = $this->Grades_Model->GetGrades();
$this->load->view(‘grades_view’, $data);[/php]
MODEL
[php]<?php
class Grades_model extends CI_model {

	function __construct() {
	parent:: __construct();
	}
	
	function Get_grades() {
	
	//generuojame atsitiktinius pazymius trims mokiniams
	
	$grades = array(
		"Petras" => array(rand(1, 10), rand(1, 10), rand(1, 10));
		"Jonas" => array(rand(1, 10), rand(1, 10), rand(1, 10));
		"Tomas" => array(rand(1, 10), rand(1, 10), rand(1, 10));
	);
	
	//skaiciuojame vidurkius
	
	function Average_grades() {
	
	$averages = array();
	foreach ($grades as $name => $grades_values) {
		$averages[$name] = round(
		array_sum($grades_values) / count($grades_values), 2);
	}
	
	// issaugome galutini duomenu masyva ir ji graziname
	
	$data['grades'] = $grades;
	$data['averages'] = $averages;
	return $data;
	}
}?>[/php]

VIEW
[php]

Grades

Grades

<table border = "1" cellpadding = "2" cellspacing = "0">
	<tr>
	<th>Name</th>
	<th>Grades</th>
	<th>Avereages</th>
</tr>
<? foreach ($grades as $name => $grades_values) { ?>
<tr>
	<td><?=$name;?></td>
	<td><? echo implode(" ", $grades_values);?></td>
	<td><?=$averages[$name];?></td>
</tr>
<? } ?> [/php]

I get an error that page is not found…

how are u trying to load the page?

Sponsor our Newsletter | Privacy Policy | Terms of Service