[nycphp-talk] need some form help...
Aaron Fischer
agfische at email.smith.edu
Tue May 27 12:22:32 EDT 2003
One way of making it easier is to not have any mention of date in the
form. You are working behind the scenes with php to input the current
date into mysql, so you don't have to ask the user anything pertaining
to date. This is nice because it is one less thing you are asking the
user to do.
In your php processing, set $date = date("Y-m-d"); Then you can use
$date along with your other form values that are posted and insert them
into the database.
HTH,
Aaron
On Tuesday, May 27, 2003, at 11:07 US/Eastern, Joshua S. Freeman wrote:
> right now everything is in the same file...
>
> J.
>
> On 5/27/03 9:38 AM, "Aaron Fischer" <agfische at email.smith.edu> wrote:
>
>> Hey Josh,
>>
>> It would depend on how you have your form page and php processing set
>> up. How do you have your logic set up? Do you have the form as one
>> page and the php processing as a separate file, or are they both in
>> the
>> same file?
>>
>> Aaron
>>
>>
>> On Tuesday, May 27, 2003, at 09:05 US/Eastern, Joshua S. Freeman
>> wrote:
>>
>>> Hi Aaron,
>>>
>>> So... if, in my form, I want both the date to both be part of my form
>>> input
>>> as well as displayed on the page when the page is loaded, how do I
>>> write
>>> that code?
>>>
>>>
>>> Say I have a webpage 'waspsurvey.php3' that contains my form.
>>>
>>> When a surveyor loads that page in his/her browser, the form is
>>> displayed
>>> for the surveyor to fill out.
>>>
>>> At a point on the form, there is the parameter 'Date:' so, I'd want
>>> ' $date = date("Y-m-d");
>>> print "$date";'
>>> in waspsurvey.php3 so that the date will print in the page.. but..
>>> what do I
>>> do to capture "$date" so that it becomes part of my form input?
>>> <input
>>> type="hidden" name="date" value="$date"> ?
>>>
>>> J.
>>>
>>>
>>> the On 5/27/03 8:20 AM, "Aaron Fischer" <agfische at email.smith.edu>
>>> wrote:
>>>
>>>> For date, In your php script that handles the form, you can do
>>>> something like:
>>>>
>>>> $date = date("Y-m-d");
>>>>
>>>> Then you can insert $date along with your other form variables into
>>>> the
>>>> mysql table.
>>>>
>>>> Aaron
>>>>
>>>>
>>>>>
>>>>>> Another point of confusion... one of the fields in the survey form
>>>>>> is 'survey_date'.
>>>>>>
>>>>>> I have field of type 'date' in my 'specimen' table... I'd like to
>>>>>> have
>>>>>> the 'survey_date' be handled automagically for the surveyor by PHP
>>>>>> and
>>>>>> MySQL..
>>>>>> any suggestions on how best to accomplish that?
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>>
>>
>>
>
>
>
> --- Unsubscribe at http://nyphp.org/list/ ---
>
>
More information about the talk
mailing list