+ 2

Can we make relation between php and JavaScript.

Can variable of php can work with javascript. Because of top database and server side language i like php but when time for animations or something php is low in level.

24th Feb 2017, 7:20 AM
Animesh
Animesh - avatar
2 Réponses
+ 17
<?php $name = "noob"; echo "<script>name = ' ".$name." ';</script>"; ?>
24th Feb 2017, 11:27 AM
Valen.H. ~
Valen.H. ~ - avatar
+ 1
Can this work: <script> (function($){ $('.class').on('click', function(){ <?php $_POST['name'] = $name; mysql_connect(//logindata); //data inject query to sql ?> } })(jQuery); </script>
24th Feb 2017, 12:11 PM
Animesh
Animesh - avatar