Thanks. Before doing that, I was planning to convert the form variables into arrays. and before I convert form variables into arrays, I was thinking of printing some of my variables when a user clicks on submit button. So I made some changes to accomplish it like this :
<form id = "myform" action="" method="post">
First name: <input type="text" name="FirstName" value="Mickey"><br>
Last name: <input type="text" name="LastName" value="Mouse"><br>
<button name = "submittest" type = "submit test">Submit Test </button>
</form>
I see. I am actually having CORS issue when using Ajax and hance trying to get things done using PHP but it looks like I will have to find some other alternative.
I believe that for testing purposes there are browser add-ons that will help with CORS, but it doesn’t help for actual production. I’m having a similar issue at the moment, as it happens.
What you are doing is called a “php proxy”. If you search on google for that term there are a few available that you can probably use for entire your project with having to write your own or replicate the same code over and over. Seems like you are heading down a path with a lot of potential for errors and duplicate logic which can be avoided using a package already availe on GitHub or composer.