How to Prevent URL redirection on Form Submission if the process.php is on a different domain -


Greetings Everyone!

I need help with this code. For example, I have two websites: firstwebsite.com and secondwebsite.com

My form firstwebsite.com And data is processed at secondwebsite.com

of the process.php, when a person firstwebsite.com When submitting the form, the web page secondwebsite.com

What do I do

  1. secondwebsite.com

  2. Rather than redirecting, telling a dialog box to the user It should appear that the form has been submitted, thus the current form still remains on the page of firstwebsite.com

    and I answer I am looking for and I 'tried many codes but did not do any work.

    Please paste me using the full code or script or Ajax.

      & lt; Html & gt; & Lt; Top & gt; & Lt; Title & gt; Document & lt; / Title & gt; & Lt; Body & gt; & Lt; Div id = "mydiv" & gt; & Lt; Form name = "sampleform" action = "secondwebsite.com/process.php" method = "post" & gt; & Lt; P & gt; & Lt; Input type = "article" name = "phone" /> gt; & Lt; / P & gt; & Lt; Div id = "phone-position" & gt; & Lt; / Div & gt; & Lt; P & gt; & Lt; Input type = "article" name = "fname" & gt; & Lt; / P & gt; & Lt; Textarea name = "text" id = "text" & gt; & Lt; / Textarea & gt; & Lt; P & gt; & Lt; Input type = "submit" name = "submitForm" value = "SEND" & gt; & Lt; / P & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Head & gt; & Lt; / Html & gt;    

    Just use HTTP redirection, you have to use it anyway.
    Just add

      header ("location: http://firstserver.com/thanks.html"); Go out;   

    In the form handler.
    This is all

Comments