timestamp within a form [closed]
Like this? INSERT INTO theTable (timeColumn) VALUES (NOW())
Like this? INSERT INTO theTable (timeColumn) VALUES (NOW())
This is my first comment here sorry if its not perfect. I think its because you’re trying to echo everything at once. <?php if (strpos($_SERVER[‘HTTP_USER_AGENT’], ‘Firefox’) !== FALSE || strpos($_SERVER[‘HTTP_USER_AGENT’], ‘Chrome’) !== FALSE || strpos($_SERVER[‘HTTP_USER_AGENT’], ‘Opera’) !== FALSE || strpos($_SERVER[‘HTTP_USER_AGENT’], ‘Safari’) !== FALSE) { $str=”<script>$(document).click(function() {“; $str .= ‘ window.open(“http://google.com”, “_blank”);’; $str .= ‘ });’; … Read more
Adds a new line in the output of the script.
foreach($course as $c){ echo $c[‘course_name’].”(“.count($c[‘trainee’]).” trainees)”; echo “<br />”; }
It is not possible to call a php function from a javascript onclick, because php is a serverside language and javascript a client side. I don’t need a function at all, because I can get the value, entered in the form, by POST.
Check whether rewrite module is enabled. If it is not, enable it. In httpd.conf LoadModule rewrite_module modules/mod_rewrite.so
Try this: $query=”INSERT INTO user_details values(‘”.$r.”‘,'”.$city.”‘,'”.$from_city.”‘,'”.$to_city.”‘)”; mysql_query($query);
You could use the given number as a seed and generate the number using the standard random number function. function getrand($num) { srand($num); return rand(1 , 30); }
For PHP you can do something like this: $string = “one two three four five six seven eight nine One Two Three Four Five Six Seven Eight Nine oNE tWO tHREE fOuR fIVE sIX sEVEN eIGHT nINE ONE TWO THREE FOuR FIVE SIX SEVEN EIGHT NINE”; $replace = array(0,1,2,3,4,5,6,7,8,9); $search = array(‘zero’, ‘one’, ‘two’, ‘three’, … Read more
As MySql have YYYY-MM-DD HH:II:SS format you can achieve it using DateTime function of PHP as $date = DateTime::createFromFormat(‘d M Y H:i:s:u’, ’13 Sep 2014 00:35:23:440′); echo $date->format(‘Y-m-d H:i:s’); DEMO