SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    if ($zee == "Guru") { $zee--;}
    Join Date
    Nov 2005
    Location
    Karachi - Pakistan
    Posts
    1,133
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with PHP DatePicker

    Hi

    Friends I m in need of a Date picker in PHP. Like I have a date field on my form and there is a Link near the text box "PICK THIS DATE" when the user click on that LINK a small window will be opened and that will have the PHP DatePicker (showing calender) . When the user selects any date from the calender, the small windows will close automatically and the selected date will appear on the date field. Plz help me with this code.

    More over, at this momen i m using following code to populate a Drop Down in order to make user able to select a date, plz let me know is this a good way ot do this ?

    <?php
    $time = time();
    $date_array = getdate($time);
    $hours = $date_array['hours'];
    $minutes = $date_array['minutes'];
    $seconds = $date_array['seconds'];
    $day = $date_array['mday'];
    $month = $date_array['mon'];
    $year = $date_array['year'];

    ?> <select name="cmbdate"> <?
    for($cnt=1;$cnt<=365*1;$cnt++)
    {
    $nextdate = mktime($hours,$minutes,$seconds,$month,$day+$cnt,$year);
    $date = strftime('%d-%m-%Y',$nextdate);
    $datecombo .= "<option value=\"{$date}\">{$date}</option>\n";
    }
    echo $datecombo ;
    ?>

  2. #2
    if ($zee == "Guru") { $zee--;}
    Join Date
    Nov 2005
    Location
    Karachi - Pakistan
    Posts
    1,133
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    anyone here to say something (About the matter) ??????????


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •