son Posted October 27, 2009 Share Posted October 27, 2009 I have fields for start time in form to submit data via email as: <p class="label"><label for="evt_hour">FROM:</label> <select name="evt_hour" id="evt_hour"> <option value="0">00</option><?php for ($i = 1; $i < 24; $i++) { printf('<option value="%d">%02d</option>', $i, $i); }?> </select> : <select name="evt_min"><?php for ($i = 0; $i < 59; $i += 30) { printf('<option value="%d">%02d</option>', $i, $i); }?> </select> </p> I gather the $_POST data to be sent as: foreach($_POST as $key=>$value) { $S.= $key .": ". $value."\n"; } The email will have those fields for example as:evt_hour: 12evt_min: 30How can I do it that it sends it as:Start time: 12:30?There are 5 other fields which do not need to be joined and are totally ok the way they are...Son Link to comment Share on other sites More sharing options...
justsomeguy Posted October 27, 2009 Share Posted October 27, 2009 Instead of using a foreach loop to loop through everything in $_POST you need to do it individually so you can format everything how you want. Or, you can modify what's in $_POST before you loop through it. Link to comment Share on other sites More sharing options...
son Posted October 28, 2009 Author Share Posted October 28, 2009 Instead of using a foreach loop to loop through everything in $_POST you need to do it individually so you can format everything how you want. Or, you can modify what's in $_POST before you loop through it.Many thanks. Will have a go...Son Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.