Jump to content

Question About Classes


Recommended Posts

Hey,How can I set multiple variables in a class but not inside a function?I have the following code but I get the following error "Parse error: syntax error, unexpected T_VARIABLE".

require_once('breadcrumbs.php');class vfrHome{	// Last ID to display in the table	public $newsid = "";	public $url = $_SERVER["PHP_SELF"]; // <-- This code is the problem, I get the error when the variable is there but the code runs when it's not there.	public function Breadcrumbs() { 		$breadcrumb = new breadcrumb;		$breadcrumb->dirformat='ucwords';		$breadcrumb->showfile=FALSE; 		echo $breadcrumb->show_breadcrumb();				echo " > Recent News";	}	}

Thanks in advance,Steve

Edited by SteveFrost
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...