Solved

Understanding PHP code - absolute path

Posted on 2009-07-15
7
207 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 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
0
 

Author Comment

by:awarraic
ID: 24859478
How do I make that header display?
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 48

Assisted Solution

by:hernst42
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.
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

733 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