i have use this code on localhost to store user emailid on serverdatabase.but i got the following error
 XMLHttpRequest cannot load http://192.232.240.245/saveemail.php?redirect=http://localhost/digital/real/comparebuy.php. No 'Access-Control-Allow-Origin' header is present on the requested resource. 
 Origin 'http://localhost' is therefore not allowed access.

 var emailID=$('#firstname').val();
 $.ajax({
               url:"http://192.232.240.245/saveemail.php?redirect="+document.URL,
               type:'post',
               data:{'emailID':emailID},
               success:function(){
                alert("ok");
               }
              })

please reply me

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.