Jump to content

[SOLVED] How do I properly code this line?


mellis95

Recommended Posts

I am having trouble figuring out how to reference a variable within a hyperlink within a class.... (I think I worded that right)

 

globals.inc:

 

<?
//-------------------
//Configure this section

$cname="Test Clinic, Inc."; //company name
$s="pto"; //server name
?>
//-------------------

 

phpddm.inc.php(partial):

$PHPDDM_menu[0] = new phpddm_menu('Documentation', 'DOCUMENTATION', 150, '#', '_parent');
$PHPDDM_submenu[0][0] = new phpddm_submenu('PT Evaluation', 'http://'$SERVERNAME VARIABLE HERE'/forms/pt/eval.php', '_parent');

 

I am trying to use the server name variable from globals.inc as the variable part of the hyperlink (second line of posted code from phpddm.inc.php). I am still fairly new to PHP, so please let me know if I am going about this completely wrong. I know that the variable works, because I can echo it in other places. I just can't figure out how to reference it in this scenario.

 

Below are the relevant portions of the phpddm class

class phpddm_menu {
     function phpddm_menu($title, $vtitle, $width, $url, $target) {
        $this->TITLE = $title;
	$this->VTITLE = $vtitle;
	$this->WIDTH = $width;
	$this->URL = $url;
	$this->TARGET = $target;
    }
}

class phpddm_submenu {
     function phpddm_submenu($title, $url, $target) {
        $this->TITLE = $title;
	$this->URL = $url;
	$this->TARGET = $target;
    }
}

 

Thank you in advance.

 

Matt

Link to comment
https://forums.phpfreaks.com/topic/156849-solved-how-do-i-properly-code-this-line/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.