Jump to content

Help! How would I do this?


Crazydog115

Recommended Posts

Alright...so I have this script and I'm trying to do something to it, and I can't figure out how...here it is...
(Only showing part)

[code=php:0]<?php
$date = getdate();
$day = $date['mday'];
$month = $date['month'];
$fourt = '<b><font face="verdana" size="1" color="#464646">1|2|3|4|5|6|7|8|9|10|11|12|13|14|</font></b>';
if ($month == 'July') {
if ($day == 14) {
echo $fourt;
}}
[/code]
What I need to do, is add links to 1|2|3|4|5|6|7| etc. so that they go to the correct page in the archive...I can do all of this, but my ONLY problem is that:

Every month uses the SAME Variables to show the numbers, so if I did

[code=php:0]
'<a href="mysite.com/Archive/July/1.php">1</a>|2|3|'
[/code]

They would all link to the July folder..
I need to know how to make it, so that I can have something like this:

[code=php:0]
'<a href="mysite.com/Archive/" . $lmonth . "/1.php">'
[/code]

where $lmonth is the month in the

[code=php:0]if ($month ==[/code]

statement. But, I cannot just use $lmonth = $month, because I have up to 6 months archives showing at once...

Ask any questions if you need to know any more!
Link to comment
Share on other sites

If I understand this right each link is a month. So shouldn't there be 12. Just wondering.

Well I guess I still don't undstand what your trying to do. so here is what I think you should do.
Create an array with the months. Have a foreach or for loop and looping each month in a link. But thats where I don't get this. Why don't you just create the html to do that. So if you could explain more. You were a little to vague.  Thanks
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.