Buffmin
04-25-2012, 06:55 PM
Hello.
I have a php page.
On this page, I break out and use html to call an image.
Rather than hand code the folder name in the image path, I would rather refer to the folder using a php variable.
(The reason is that there will be multiple similar pages, refering to different geographical areas, and each one has it's variable set at the top of the page.
The variable (that refers to the folder is called $area). In this case $area= "Apache Junction"
First, I will show you the code as it is now (and does work).
Then I will show you the code that I tried (and doesn't work).
PS: do not get a php error, but it does not find the image)
I appreciate any help. Buffmin
Current Code:
<img src="images/Apache Junction/image1.jpg">
PHP code that DOES NOT work
<img src="images/<? $area ?>/coulter13.jpg" title="">
PS Again.... It seems like maybe it is because I have to leave a space on each side of the variable name?
(I have to leave the spaces or in Dreamweaver, the tags turn from red to blue)
I have a php page.
On this page, I break out and use html to call an image.
Rather than hand code the folder name in the image path, I would rather refer to the folder using a php variable.
(The reason is that there will be multiple similar pages, refering to different geographical areas, and each one has it's variable set at the top of the page.
The variable (that refers to the folder is called $area). In this case $area= "Apache Junction"
First, I will show you the code as it is now (and does work).
Then I will show you the code that I tried (and doesn't work).
PS: do not get a php error, but it does not find the image)
I appreciate any help. Buffmin
Current Code:
<img src="images/Apache Junction/image1.jpg">
PHP code that DOES NOT work
<img src="images/<? $area ?>/coulter13.jpg" title="">
PS Again.... It seems like maybe it is because I have to leave a space on each side of the variable name?
(I have to leave the spaces or in Dreamweaver, the tags turn from red to blue)