skip to Main Content

my php isset is not working in POST method – Jquery ajax

This is my test.php code <input type="button" value="click me" name="my_btn" onclick="mybtn();"> <?php echo("before is set"); if(isset($_POST['hello'])=="dear"){ echo("after is set true"); } ?> <script src="vendor/jquery/jquery.min.js"></script> <script> function mybtn(){ $.ajax({ url:"http://localhost/mysites/php_two/test.php", method:"post", data:{hello:"dear"}, }); } </script> when button is clicked, page only…

VIEW QUESTION

Send AJAX data to Node.js – Jquery ajax

Unable to send data to Node.js from my HTML/AJAX, I have variable selectValue which I want to send to my Node server. While making use of data: { selectValue: selectValue} does not help. index.html <script type="text/javascript"> $(document).ready(function(){ var selectElement =…

VIEW QUESTION
Back To Top
Search