WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Dynamic listbox of years, starting from a current year
Categories : PHP, Date Time Click here to Update Your Picture
Alex Gorski
Date : Jan 14th 2003
Grade : 3 of 5 (graded 2 times)
Viewed : 5777
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Alex Gorski
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

Try this function to generate a listbox of any number of years, starting with a current year.
Years before a current year will not be displayed in the list of options. The function can be used on a form to enter credit card info.

<?php
function list_years($list_name, $num_years, $sel_year = '') {

 
$list .= "<select name=$list_name>\n";
  if (
$sel_year == '') $list .= "<option value=''>Year</option>\n";

 
$year = date("Y"); //get current year

 
for ($k=0; $k<$num_years; ++$k) {
    if (
$sel_year == $year)$list .= "<option value=$year selected>$year</option>\n";
    else
$list .= "<option value=$year>$year</option>\n"
   
$year += 1;
  }

 
$list .= "</select>\n";

  echo
$list;
}

/* function call examples */
list_years("cc_year", 10);
list_years("cc_year", 10, 2005);
?>



Functions used to define a schedule of holidays. Can define non-fixed holidays (eg. 3rd sunday of June).
Categories : Calendar, Date Time, PHP
PHP Calendar
Categories : PHP, Calendar, Date Time, Java Script, CSS
calculus of the eastersunday
Categories : BC math, PHP, Date Time, Databases
Select with current month
Categories : PHP, HTML and PHP, Date Time, Arrays
PHP Round Clock - Must have Gif support to use this.
Categories : PHP, Date Time, Graphics
This script contains 2 functions: 1 to create html select object based on your own customer date format entry- "M d Y h:i.... etc". The second function processes the select object on submit back to unix time.
Categories : PHP, Calendar, Date Time, HTML and PHP
Website colour changer
Categories : PHP, HTML and PHP, Date Time
Calendar, Kalender, date, time, day, month, year
Categories : PHP, Date Time, Calendar
List people whose birthdays fall on the current Day and Month
Categories : Databases, Date Time, MySQL, PHP
Validator - A PHP class that can can be used for validating Email IDs and Dates
Categories : PHP, PHP Classes, Data Validation, Email, Date Time
In Mysql, the 'datetime' data type is used to store date that looks like '2007-10-16 16:26:30'. we are going to design a function called mysqldate() that takes a mysql date and output format as input and outputs a well formated date.
Categories : PHP, Date Time, Databases, MySQL
A simple and fast calendar combining PHP and tables. Use this as a base for applications in which a calendar is needed.
Categories : Date Time, PHP, Complete Programs, Calendar
Calendar using Date function
Categories : HTML and PHP, PHP, Date Time, Calendar
Data Retrieve from Mysql using AJAX with PHP
Categories : PHP, AJAX, Date Time, Databases, MySQL
A Timing Class
Categories : PHP, PHP Classes, Date Time