dadamssg Posted January 19, 2009 Share Posted January 19, 2009 can somebody make this work? its sayin i have an unexpected "." somewhere....i want it to output this for example Jan-12-2009 5:25 pm or Jan/12/2009...either/or, thanks $begin = $_POST['smonth']."-".$_POST['sday']."-".$_POST['syear']. .$_POST['shour'].":".$_POST['sminute'].":00".$_POST['sampm']; Link to comment https://forums.phpfreaks.com/topic/141428-fix-variable/ Share on other sites More sharing options...
RichardRotterdam Posted January 19, 2009 Share Posted January 19, 2009 you see this part? $_POST['syear']. .$_POST['shour'] there are two dots there remove one Link to comment https://forums.phpfreaks.com/topic/141428-fix-variable/#findComment-740314 Share on other sites More sharing options...
dadamssg Posted January 19, 2009 Author Share Posted January 19, 2009 thanks it worked! but how do i add 10 to the $_POST['shour'] variable and update it. i have drop down for AM PM, and i want to add 10 so i can enter it enter DATETIME correctly this is what i got...no good though if($_POST['sampm'] = 'pm') { $_POST['shour'] = $_POST['shour'] + 10 } Link to comment https://forums.phpfreaks.com/topic/141428-fix-variable/#findComment-740320 Share on other sites More sharing options...
dadamssg Posted January 19, 2009 Author Share Posted January 19, 2009 and when i say 10 i mean 12...wow im an idiot haha Link to comment https://forums.phpfreaks.com/topic/141428-fix-variable/#findComment-740323 Share on other sites More sharing options...
Prismatic Posted January 19, 2009 Share Posted January 19, 2009 thanks it worked! but how do i add 10 to the $_POST['shour'] variable and update it. i have drop down for AM PM, and i want to add 10 so i can enter it enter DATETIME correctly this is what i got...no good though if($_POST['sampm'] = 'pm') { $_POST['shour'] = $_POST['shour'] + 12 } <?php if($_POST['sampm'] = 'pm') { $shour = $_POST['shour'] + 10; } ?> You cant modify a $_POST variable like that Link to comment https://forums.phpfreaks.com/topic/141428-fix-variable/#findComment-740326 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.