Jump to content

Recommended Posts

Hi,

I've been doing standard php off and on for a few years and decided to learn OPPphp starting with Stephan Mishtook's decent video tut.

Problem: simple name object won't show in the browser (just a blank page, no default errors)

Using LAMP with full permissions. Php 5

Here is the index.php:

<html>

<head>

<title>OPP in PHP</title>

<?php include("class_lib.php"); ?>

</head>

<body>

 

<?php

$bruce new person();

echo $bruce->get_name();

?>

 

</body>

</html>

 

And here is the class file:

<?php

class person {

var $name = "bruce";

    function get_name(){

    return $this->name;

    }

 

}

?>

 

Where do the OOP questions on this message board go?

Link to comment
https://forums.phpfreaks.com/topic/163949-oop-nobb-q-simple-object-wont-show/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.