Skip to content
Advertisement

PHP POST method Form Redirecting on action Page

I have created a simple HTML Form With Action on Different Website After form data submission user is redirecting to action page but I want user stay on my website and form data go on another website..please help me

here is sample form

               <form class="form" action="https://api.promopmi.center/v1/sms/infobip" method="post">
               
                   <ul>
                       <li>
                           <input name="test1">
                       </li>
                       <li>
                           <textarea name="name112"></textarea>
                       </li>
                       
                       
                       <li>
                           <button type="submit" id="submit">Send SMS</button> <i id="result"></i>
                       </li>
                   
                       
                   </ul>
               </form>
           </div>```

Advertisement

Answer

Use an iframe, and submit the data to that, using target="iframeName", for example:

<iframe name="iframe1"></iframe>
<form class="form" action="https://api.promopmi.center/v1/sms/infobip" method="post" target="iframe1">

This way you will stay on the same page.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement