Understanding PHP code - absolute path

Posted on 2009-07-15
Last Modified: 2013-12-13
I am working on a php web application. Trying to understand the path to files:
What does following code means?

img src="$$application_settings::base_path$$images/header.gif"

Why are there two dollar signs? (it's php 4.4.7)

Question by:awarraic
LVL 18

Expert Comment

by:Greg Alexander
ID: 24859409
I never use $$ but here is the explanation of it:
LVL 48

Accepted Solution

hernst42 earned 250 total points
ID: 24859446
No this is template system. Somewhere you configure the value for application_settings::base_path and then in that file $$application_settings::base_path$$ is replaced by the template engine with the configured/calculated value. This has nothing to do with the $$ of php beasue you would get something like:

img src="foo::base_pathBAR/header.gif"

in your html

Author Comment

ID: 24859478
How do I make that header display?
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

LVL 48

Assisted Solution

hernst42 earned 250 total points
ID: 24859561
> Why are there two dollar signs? (it's php 4.4.7)
beacuse the programmer defined that variables for his template engine are stored between $$ and $$. Could also be ## and ##

> How do I make that header display?
Configure the template engine correctly.
LVL 19

Expert Comment

ID: 24875584


$$image will create a "PHP variable" with the name CONTAINED in the variable $image.

so if:
$image = 'pictures';
$$image would reference a variable named $pictures

Wha you want is to just change it to:
img src="http://www.yourwebsite/com/images/header.gif" // path to header.gif

Open in new window

LVL 19

Expert Comment

ID: 24875587
Correction $$ will reference a variable based on the $variable

so if:
$image = 'pictures';
$image would reference a variable named $pictures

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now