質問

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

役に立ちましたか?

解決

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

他のヒント

I think you can use $_GET['variable_name']; in your 2.php

You can check form documentation here http://www.w3schools.com/php/php_get.asp

Use can use CURL function for more detail.. http://php.net/manual/en/curl.examples.php

and store $result in database,$result is an array so use (foreach) loop for fetch data and it also provide a response of ur api is success or fail.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top