felito Posted April 12, 2011 Share Posted April 12, 2011 hi in the code above i want to send the name (with imput data by user, in case username) to a php file but $name = $_POST['name']; <<<<<<<<<<<< this not retrieve nothing in the php file js file <script type="text/javascript"> $(document).ready(function() { $("#customForm").submit(function() { $.ajax({ url: "validation.php", type: "post", dataType: "json", data: { name: $('#name').val()}, success: function(data) { if (data.validateName) { $("#msgbox1").fadeTo(200, 0.1, function() { $(this).html('Nome inválido ou já registado na base de dados').addClass('messageboxerror1').fadeTo(900, 1); }); } else { $("#msgbox1").fadeTo(200, 0.1, function() { $(this).html('Logging in.....').addClass('messageboxok1').fadeTo(900, 1, function() { document.location = 'secure.php'; }); }); } }}); return false; }); }); </script> any reason for that? i test name="john" and with the name the validation is correct, so the problem is the name that is not send by js file thanks Quote Link to comment https://forums.phpfreaks.com/topic/233429-not-working-as-i-expect/ Share on other sites More sharing options...
Adam Posted April 12, 2011 Share Posted April 12, 2011 Can you show us the name input? Quote Link to comment https://forums.phpfreaks.com/topic/233429-not-working-as-i-expect/#findComment-1200422 Share on other sites More sharing options...
felito Posted April 12, 2011 Author Share Posted April 12, 2011 i solve the issue. The problem is in the php file, not the js. A problem with the login of returns thanks! Quote Link to comment https://forums.phpfreaks.com/topic/233429-not-working-as-i-expect/#findComment-1200518 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.