如何将JavaScript变量用作PHP变量?
我试图将PHP变量作为PHP变量包含在PHP代码中,但我遇到了这样的问题。单击按钮时,将调用以下函数:
<script type="text/javascript"> function addTraining(leve, name, date) { var level_var = document.getElementById(leve); var training_name_var = document.getElementById(name); var training_date_var = document.getElementById(date); <?php $result = "INSERT INTO training(level, school_name, training_date) VALUES('level_var', 'training_name_var', 'training_date_var')" or die("Query not possible."); ?></script>
可能吗?
米琪卡哇伊
慕妹3146593
湖上湖