🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.golive.dynamic.content
Article #34

Re: Formatting a user input date

#34
From: LenHewitt
Date: Fri, 25 Jun 2004 22:20
28 lines
1603 bytes
Jeremy,

>>how do you 're-assemble' the 3 values into a single string <<

Hand code it. $date=$_POST['year'].$_POST['month'].$_POST['year'];

>>how would I handle the drop boxes if someone wanted to update the date<<

A little more complicated.

Easier if you create 3 arrays, one each for day, month and year and fill
with possible values, with a blank value at [0]

Assuming the date you retrieve from the d/base is formatted into the three
variables $day_selected, $month_selected, $year_selected:

<select name="day" size="1">
 <?php
         $count=1;
  while ($count<=31){
        print ("<option value=\"$count\""); if($count==$selected) PRINT("
selected"); PRINT(">$day[$count]</option>\n");
        $count++;
   }
 ?>
</select>

repeat for month and year
Technical Details
Message-ID: <AD90A34765B433469B34E3A9F88AB9F6@in.webx.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!webx
References: <3bb4c65d.-1@webx.la2eafNXanI> <3bb4c65d.1@webx.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11ffd2,8502de635f9b659d
X-Google-Attributes: gid11ffd2,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: LenHewitt@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!webx
Newsgroups: adobe.golive.dynamic.content
Subject: Re: Formatting a user input date
Message-ID: <AD90A34765B433469B34E3A9F88AB9F6@in.webx.la2eafNXanI>
Date: Fri, 25 Jun 2004 15:20:48 -0700
References: <3bb4c65d.-1@webx.la2eafNXanI> <3bb4c65d.1@webx.la2eafNXanI>
Lines: 30
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4922.1500
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4939.300
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit