Dear friends/moderators
I am developing a page. In that page at some location one image will be displayed. The image will change according to date & month. For changing the image i am using php script. The problem is, i am unable to integrate the file location in the html file.
php code:
-------------------------------------------------------------------------------------------
<?php
$holidays = array(
'01-01' => 'newyear',
'02-14' => 'valentines',
'03-17' => 'saintpatricks',
'04-12' => 'easter',
'12-25' => 'christmas',
);
$date = date('m-d');
if (isset($holidays[$date])) {$logo = 'holidays/logo_' . $holidays[$date] . '.gif';}
else {$logo = 'holidays/logo_default.gif';}
echo '<img src="' . $logo . '">';
?>
-----------------------------------------------------------------------------------------
I saved this code holidays.php
I want to integrate the path of the php in the below code at
<IMG SRC="holidays/IMAG003.JPG" WIDTH=533 HEIGHT=335 BORDER=0>
in the above line already another image is there it was in red color & it should be changed with another image as in the php code.
I inserted like this but not working
<IMG SRC="holidays.php" WIDTH=533 HEIGHT=335 BORDER=0>
html code in my page
---------------------------------------------------------------------------------------
<DIV ID="SGROBJ7D9431612262221" STYLE=" position:absolute; top:160px; left:232px; width:533px; height:335px; z-index:3;">
<IMG SRC="images/IMAG003.JPG" WIDTH=533 HEIGHT=335 BORDER=0>
</DIV>
-----------------------------------------------------------------------------------------
I n the above html code how to change for working the php code.
please help me. I had this trouble since one week.
waiting for your replies
thanks in advance.
|
Go4Expert Founder
|
![]() |
| 23Apr2009,15:50 | #2 |
|
Does your holidays.php output image url as
echo '<img src="' . $logo . '">'; But you expect only the $logo url and so you should see that logic |
|
Light Poster
|
|
| 23Apr2009,15:53 | #3 |
|
Sir this is working for me in php when i executed but i was unable to use in html for changing the image.
Sorry sir i dont know php & i am new to this please help me. waiting for ur reply. |
|
Go4Expert Founder
|
![]() |
| 23Apr2009,17:24 | #4 |
|
When you use the following code
<IMG SRC="holidays.php" WIDTH=533 HEIGHT=335 BORDER=0> The output becomes <IMG SRC="<img src="holidays/logo_default.gif">" WIDTH=533 HEIGHT=335 BORDER=0> I hope this helps and you understand what is wrong |
|
Light Poster
|
|
| 24Apr2009,03:02 | #5 |
|
sir it is not working, my be i didn't explained properly for you.
|
|
Go4Expert Founder
|
![]() |
| 24Apr2009,08:40 | #6 |
|
So then try to explain because its difficult to read your mind.
|
|
Light Poster
|
|
| 25Apr2009,16:46 | #7 |
|
<?php
$holidays = array( '01-01' => 'newyear', '02-14' => 'valentines', '03-17' => 'saintpatricks', '04-12' => 'easter', '12-25' => 'christmas', ); $date = date('m-d'); if (isset($holidays[$date])) {$logo = 'holidays/logo_' . $holidays[$date] . '.gif';} else {$logo = 'holidays/logo_default.gif';} echo '<img src="' . $logo . '">'; ?> Sir the above code is executing in php. So i want to execute through the html page i.e. take a new html page named as some xxxxx if i open that page the above program should be executed at certain position in the page like top=100, left/right= 200 (x,y axis) with a particular size of the image because all the images will not be in the same size. |
|
Go4Expert Founder
|
![]() |
| 25Apr2009,18:59 | #8 |
|
Just including the file should do it.
|
|
Light Poster
|
|
| 26Apr2009,12:20 | #9 |
|
sir i dont how how to include the file please help me how tot include the file in html with in the body.
aiting for ur reply. |
|
Go4Expert Founder
|
![]() |
| 26Apr2009,12:55 | #10 |
|
inlcude('path/to/file')
|

