?
Solved

Understanding PHP code - absolute path

Posted on 2009-07-15
7
Medium Priority
?
210 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

777 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