You can easily get JavaScript variable values on the same page in PHP. Please try the following code:
<script> var res = "success"; </script> <?php echo "<script>document.writeln(res);</script>"; ?>
The above is the detailed content of How to pass JavaScript variables to PHP?. For more information, please follow other related articles on the PHP Chinese website!