Forum Moderators: coopster

Message Too Old, No Replies

help with php not outputting data to my web browser

php: problem outputting data to my web browser

         

rodriguez1804

8:40 pm on Jul 17, 2008 (gmt 0)

10+ Year Member



Hi guys,

Can somebody please tell me why the code below is not showing any output to my web browser.

I am trying to re-write some of my code in this Object Oriented style.
I am only using this code below as an example, but just can't get it to output any data. All my other php scripts work just fine, but they are not written in this style. Thanks


<?php
class Product{
private $name;

public function product(){}

protected function setName($name){$this->name = $name;}
public function getName(){return $this->name;}

}

class Car extends Produc{
private $model;

public function Car($name, $model)
{
parent::setName($name);
$this->setModel($model);
}

private function setModel($model){$this->model = $model;}
public function getModel(){return $this->model;}
}

$car = new Car("name", "model");

echo "HELLO"; //even this won't ouput anything?

echo $car->getName();
echo $car->getModel();

?>

janharders

8:46 pm on Jul 17, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



class Car extends Produc{

you're missing a "t" here. guess you have error_reporting set to not output any errors...

rodriguez1804

8:54 pm on Jul 17, 2008 (gmt 0)

10+ Year Member



lol, silly me! That will do it. Yeah, I have error_reporting off: next time I 'll check my error log first. Thanks a bunch!