I've created a simple form located on another website(server).
When the form on www.b.com is submitted using the www.a.com/best-rate.php action I'm getting no return values from the input.
I'm trying to figure out how to get the input information from server to server. For some reason when I run this I get
false
which indicates that it is not set. Am I over thinking this? Should this not return the value or should I do something different?
www.a.com/best-rate.php
include "db_conx.php";
if (isset($_POST['name']))
{
echo 'true';
}
else
echo 'false';
The form is located below and on website B. Again, this is on another website and server all together. We'll call it www.b.com
www.b.com (Where the form is located)
<form action="https://www.a.com/best-rate.php" method="post">
Name: <input type="text" name="name"><br>
E-mail: <input type="text" name="email"><br>
<input type="submit">
</form>
UPDATE
When using the get method I'm able to receive the form inputs, but post seems to not want to accept them. In the future, sensitive information could be passed so I want to stick with post.
UPDATE .htaccess
Header add Access-Control-Allow-Origin "*"
Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type"
Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"