Jump to content


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


If-Else Linking.

Recommended Posts

If-Else Linking.

Hello, I am completely new to this forum so you must forgive me if this topic has been covered before. Thank you.

I am trying to set up a link that changes its destination depending on what month it is. Its not exactly a calendar that I am looking for, it’s simply a link to different pages.

I am also “fairly new” to PHP so any help you can give or direction you can point me in would be greatly appreciated.

All I need is a Text or Graphic Link that:

• Depending on what month it is, displays a different page.
• Tracks the month with a PHP Variable.

Share this post

Link to post
Share on other sites
This will do all the months in the year.

1 make a folder called images.

2. make images a - i . gif

good luck.



























echo "<img src='$pic'></img>";

Share this post

Link to post
Share on other sites
$month = strtolower(date("F")); // gets the lowercase month name for the current date
echo "<a href='". $month. ".php'><img src='images/". $month. ".gif'"></a>";

If the month is September, for example, then the link will go to september.php and the clickable image in the link will be september.gif ... you get to create all the images and .php files yourself.

Is that sort of what you were looking for?

Share this post

Link to post
Share on other sites


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.