HTML URL button with variables

I really need some help. As you can see under in the code, I have a receiver, sender and a message for my site. When I click the button on the page it enters the page and sends the message to the receiver I enter in the URL. So what I want it to do: I want it to get the receiver, sender and message from the form into my URL. I have tried with PHP variables and JavaScript variables, but I can't get it to work.

<form>

Reciever: <input type="text" name="rcv" /><br><br>

Sender: <input type="text" name="snd" /><br><br>

Message: <input type="text" name="msg" /><br><br>
</form>


<div>
   <a id="mybutton" href="http://example.com/http4sms/send.asp?USER=Steffen&PW=steffen123&RCV=4782123254&TXT=hello&SND=Steffen" title="link to example.com/http4sms/send.asp?USER=Steffen&PW=steffen123&RCV=4782123254&TXT=hello&SND=Steffen">
   <button>Send Message</button>
   </a>
</div>

Answers


change <form> to

<form method="GET" action="">

The get will append the name and value of your fields into the url. You should always use the method and action attributes of the form.


Need Your Help

pre-flight OPTIONS request for CORS

javascript angularjs node.js cors

I use a middle call cors like this in development