Hi all,
Am going mad trying to get something to work.
I'm creating a CMS for a magazine. The magazine is published every 2 months and therefore the edition is nov-dec or jan-feb etc.
I've an archive option on the site and rather than listing:
dec
nov
oct
sept etc
I'd like to follow the magazine editions:
nov-dec
sept-oct
The code I have so far is:
echo '<p>Sort By:</p>';
$year = date("Y"); //get the current year
$startDate = "1 january".$year; // set the end date to current year
function printMonths($var)
{
$start = strtotime($var); //timestamp of the entered date
$now = strtotime("Now"); //timestamp of now so it does not write anything in the future
while ($now > $start) //while the start is less than now
{
echo '<a href="news_archive.php?s=&id=' . get_id() . '&month=' . date("F", $now) .'">'.date("F", $now).'</a>';
echo " | ";
$now = strtotime("-1 month", $now); // subtract a month from the start timestamp
}
}
printMonths($startDate); //execute the function
this works well listing the months from the current month back. But this is not what I need. If I alter the line
$now = strtotime("-1 month", $now);
to
$now = strtotime("-2 month", $now);
It starts in Nov and goes back to sept which is not right. It also doesn't show nov-dec etc.
Any help on this is much appreciated
Multidimensional array problems in $_POST
I'm having trouble with a three-dimensional $_POST array. It starts as a two-dimensional array on this side:Code: <html> <head>
Login Functionality Working Different on IE
This is an odd one, I have a site which has an admin section. The admin pages unsurprisingly require you to be logged in to access them. Each admin page has the following at the top to check that the
Lining up columns nicely.
Hello everyone, I'm having problems with making columns line up properly. Here is my code:
Include with Parameters
In a particular page I would like to include a file that requires $_GET parameters.when I go to this sort of url I get what I want.http://www.example.com/test.php?id=1234567890I want the url to be
PHP code for a proxy
I was wondering which function I could use to create an online proxy tool. I was thinking cURL would work, but it just doesn't seem appropriate, for cURL is mostly used form getting data. Any ideas?
values not being entered into table
hi. I;ve created a form, so that when a user enters data into it, it gets added to a table in a database. the form submits some data to one table, and other data to another table. my problem is that
Big O & time complexity ???
can you help me how to calculate the Big O & time complexity for any algorithm and c++ program please?
Phase Error I can't seem to find :(`
Hey guys, I can seem to find my phase error on this. I am getting this error[error]Parse error: syntax error, unexpected $end in /home/klrbal/public_html/Mafia-test/tempfam.php on line
Javascript form submit and radio buttons?
When this form is submitted, it is automatically resubmitted using JS.All my fields are carried over in the $_post except for total, and state which are radio buttons and a drop down.Code:
phpmailer class & pop.gmail.com?
Code: <?php $mail->IsSMTP();$mail->Host = "pop.gmail.com";$mail->Port = 995;$mail->SMTPAuth = true;$mail->Username =