Answer the question
In order to leave comments, you need to log in
How to connect JS with PHP correctly?
Good afternoon, gentlemen :)
I want to use the insert () method at the DB facade every 2 seconds and looked towards JS, but I can’t figure out how to shove the pykher code into JS, I found options with variables, but I think that’s how they do it somehow not right.
Found an example:
<script language=javascript>
var jsvar;
jsvar = <?php echo $phpvar;?>
</script>
DB::table('zagon_all')->insert(
['id' => '']
);
var timerId = setInterval(function() {
// Сюды хочу засунуть данную тему с добавлением данных в БД
}, 2000);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question