Jump to content

Date+FutureTime?? (+ session cookie - hopefully:-?)


BoarderLine

Recommended Posts

Hi there,

 

I have a form that when submitted has 2x hidden fields.  The first hidden field enters a Join Date into the database and the second an Expiry Date (Date + 6 months) from account setup.  I am using DW CS3 and have entered the code {now} into the default value field for the date entry which seems to be working fine however am using {now + 6 months} for the expiry value for the second field, which is not working:-(.  I have tried several alternate values here and searched for hours however nothing seems to work???

 

$userRegistration->addColumn("Join_Date", "DATE_TYPE", "VALUE", "{NOW} ");

$userRegistration->addColumn("FreeExpire", "DATE_TYPE", "VALUE", "{NOW + 6 months}");

 

Secondly, is it possible to have the Expiry Date set as a session cookie also when the form is submitted?? How could I achieve this ? :-/

 

Appreciate any help on this - Thanks. 

Link to comment
https://forums.phpfreaks.com/topic/132361-datefuturetime-session-cookie-hopefully/
Share on other sites

Hi BoarderLine,

 

What class are you using to access this function? Not exactly sure what it does...

$userRegistration->addColumn

 

You shouldn't store this kind of thing in a hidden form field. People could change them easily and maybe set their join date/expiry date to whatever they want. You should handle this yourself in the script that handles the form submission with something like:

 

$seconds_in_6months = 60*60*24*30*6;

$join_date = time();
$expiry_date = $join_date + $seconds_in_6months;

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.