I want save values from htlm in variable php [on hold]

70
January 12, 2019, at 08:50 AM

HELP ME PLEASE

I want save values from html in variable php

I want to save the value from javascript through html to the variable in php

this is my code :

<h3>Timer
<br>
<time id="countdown"></time>
<?php 
$durasi_sementara =. '<time id="countdown"></time>' ;
$this->session->set_userdata('durasi_simpan',$durasi_sementara); 
?>
</h3>
Answer 1

Use Ajax after page load for save in session

$(document).ready(function(){
$.ajax({ 
type: 'post',
url: "set_time_on_session.php",
  data: {'countdown':$('#countdown').val()},
     success: function(){
        }
        });
});

Code for save in session set_time_on_session.php

$this->session->set_userdata('durasi_simpan',$_POST['countdown']); 
READ ALSO
How to install v8js for php5.6 on Centos 6?

How to install v8js for php5.6 on Centos 6?

I follow step by step from this : https://gistgithub

57
The &#39;queries&#39; variable is already used as an &#39;array expression&#39;

The 'queries' variable is already used as an 'array expression'

I am importing countries from an API like so

60
Sanitize filter for date parameter in php

Sanitize filter for date parameter in php

what should be the sanitization scheme for date parameter?? in php =>eg

65