Jump to content

I need an iframe that calls up a different page according to the date


cargogirl

Recommended Posts

hi

 

I don't know any php (only html) and I urgently need to do the following:

 

I need an iframe that calls up a different page according to the date

 

e.g. on the 2th Dec a page called 'special2.php', then on the 3rd Dec a page is called up 'special3.php'

 

 

 

can anyone help. I have done numerous searches but have come up with no answers

 

To address your question,

 

<?php
$day = date("d");
?>
<iframe src="special<?php echo $day; ?>.php"></iframe>

 

I have a feeling that unless you are doing something completely different on each page, that you could easily combine all your "special" files into one file. Why exactly do you have a file for each day of the month?

thanks for you prompt reply.

 

we are having a sale where the product discounts everyday and we are using paypal order buttons for purchase which means that the paypal button has to be coded with the price. So I though making a page for each day with the correct prices coded on the paypal button.

 

 

I don' t understand how the php calls up the file, meaning how does it know which file to calll up on which date?

 

 

 

do you mean if the file is named  'specials27.php'  it will call up the file on the 27th.

 

does the date come from the users computer or the server. I did try to test this and the same file kept loading after I changed the date on my computer

 

 

sorry for being such a dummy

PHP is a server side language, so the time is coming off of the server. No user input needed. Did you try the code? It should work exactly the way you want it to. Check out the php manual for more date() information.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.