Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Understanding PHP code - absolute path

Posted on 2009-07-15
7
Medium Priority
?
211 Views
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)

0
Comment
Question by:awarraic
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 19

Expert Comment

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

http://www.php.net/manual/en/language.variables.variable.php 
0
 
LVL 48

Accepted Solution

by:
hernst42 earned 1000 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
0
 

Author Comment

by:awarraic
ID: 24859478
How do I make that header display?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 48

Assisted Solution

by:hernst42
hernst42 earned 1000 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.
0
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 24875584
*** $$ IS EXTREMELY DANGEROUS ***

Basically,

$$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

0
 
LVL 19

Expert Comment

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

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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

618 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