Hi there,
Im fairly new to PHP (2 days exp with it), ive had 4 years xp with C/C++ though, so im sorry if my terminology is a bit whack or im just doing things php doesnt allow.
Anyway here is my main problem:
//Class_File.php
class PHPClass
{
var $String1;
function PHPClass($RandomString){$String1 = $RandomString;}
function Print_String() {echo $String1;}
};
//Web_Page.php
require("Class_File.php");
$String = "PHP is cool";
$PHPObject = new PHPClass($String);
$PHPObject->Print_String();
//echo $String;
right then... with the above code in its current state it just creates a page with no source code. im sure there is a really good reason why but i just cant see it. However if i uncomment the line:
//echo $String;
It shows "PHP is cool" in there, so how come it wont display this when its in the class? anyway i hope this shows you what im attemping to do...
Any help would be great.. lol as im stumped..