Go4Expert

Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   problem with HTML & PHP please help me (http://www.go4expert.com/forums/html-php-help-t17070/)

varaprasadreddy 23Apr2009 15:29

problem with HTML & PHP please help me
 
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.

shabbir 23Apr2009 15:50

Re: problam with HTML & PHP please help me
 
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

varaprasadreddy 23Apr2009 15:53

Re: problam with HTML & PHP please help me
 
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.

shabbir 23Apr2009 17:24

Re: problem with HTML & PHP please help me
 
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

varaprasadreddy 24Apr2009 03:02

Re: problem with HTML & PHP please help me
 
sir it is not working, my be i didn't explained properly for you.

shabbir 24Apr2009 08:40

Re: problem with HTML & PHP please help me
 
So then try to explain because its difficult to read your mind.

varaprasadreddy 25Apr2009 16:46

Re: problem with HTML & PHP please help me
 
<?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.

shabbir 25Apr2009 18:59

Re: problem with HTML & PHP please help me
 
Just including the file should do it.

varaprasadreddy 26Apr2009 12:20

Re: problem with HTML & PHP please help me
 
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.

shabbir 26Apr2009 12:55

Re: problem with HTML & PHP please help me
 
inlcude('path/to/file')


All times are GMT +5.5. The time now is 04:54.