Set publish and expire date for articles with submitcontent

forwarddesign 25 Dec, 2011
Hi!
I use the form submitcontent.cfbak and would like the user to set start for publishing and expire date. How can I do that?

I have started a bit with a textbox:

<div  class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label">Starta publisering:</label><input class="cf_inputbox" maxlength="150" size="30" id="text_5" name="detailspublish_up" type="text">


and in onsubmit after...

<?php

$_POST['id'] = '';
$_POST['sectionid'] = '1';
$_POST['state'] = '1';
$_POST['created'] = date("Y-m-d H:i:s");
$_POST['detailspublish_up'] = date("Y-m-d H:i:s");
$_POST['detailspublish_down'] = date("Y-m-d H:i:s");
?>
GreyHead 29 Dec, 2011
Hi forwarddesign,

You need to make sure that the input returns a valid date (or date and time). Then use a little PHP to get the date/date+time format correct and put the values into the appropriate $_POST array entries.

Bob
This topic is locked and no more replies can be posted.