Search code examples
phpclickatell

PHP form that does GET and Post


I have a form that sends a SMS via Clickatell in accordance to their HTTP api

<form action="http://api.clickatell.com/http/sendmsg" method="get">

This works, But I need to save the SMS I send to my SQL as well. I know to send I need to use method="post"

But then this will not get the number and text I want to send and send it.

How can I make it that it gets the info from the form and also post it to the SQL.

Presuming the form is 1.php and the submit to sql is 2.php


Solution

  • You could make the form post all of the data, and save your text in a database, then do a cURL call to the clickatell API afterwards. Google cURL get_page function for example on how to use cURL to load a page