View Full Version : pass the value and show article title list?

05-27-2011, 08:47 AM
i want to echo something like the following in a file(eg: test.php). like a blog year/month archive

the code output it may be:

$months = 10; //count of months
$date = date_create( 'now' );
echo date_format( $date, 'Y M' );
for ( $i = 0; $i < $months; $i++ ) {
date_sub( $date , date_interval_create_from_date_string( '1 months' ) );
echo date_format( $date, 'Y M' );
i fell the code isn't very good. the above is the year-month archive. now i want to when the user click the year-month. then in the current page shows each articles' title with list that belong to the year-month. i know i should use a passed value into my database query then select out each articles' title.supposed each article created time is stored as this 15806927473. but i don't know how to passed the value. when the user click the year-month. and use the passed value in my sql query. thank you.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum