I have been battling with my sign-up code,
I got an API from an sms company, I want users to get sms after sign-up.
But which i found so challenging. Kindly help me out.
Whatâs the error message or response you are getting?
Good moring, Thanks for your reply.
Here is my code that submit to DATABASE
$sql="INSERT INTO ads (ads_title, ads_content, poster, status, date, song, songsize, ads_pic)
VALUES
(â$titleâ,â$bodyâ,â$posterâ,â$categoryâ,â".date(âY-m-d H:i:sâ)."â,â$songâ,â$songsizeâ,â$locationâ)";
$test =
if (!mysql_query($sql))
{
die('Error: â . mysql_error());
}
header(âlocation: myfunctions.phpâ);
exit();
}}
?>
THIS IS THE âmyfunctions.phpâ PAGE with the SMS API
<?php header("location: https://smartsmssolutions.com/api/?message=Bad&to=08066291798&sender=SGZ Ent 3&type=0&routing=3&token=jQeNHcccn7XiK4RjyXIM0MbemmxNxYYokP2LBIEO4QrweedpThLdfxQGcYI1EpmZ1pLoLAGkNdTqC78y3CiRVOaBa5z64EY3a"); //header("location: home.php"); ?>My major problem is that, the SMS is sent but the page refuse to redriect to ââhome.phpââ
Hi, from what you have in the myfunction.php file youâre re redirecting to the SMS provider rather than your home page. You re supposed to send a get request to the SMS API and then redirect to your homepage
hoo sowi, i comment on the the second header. before i copy the code.
this is what i actually have there
THIS IS THE âmyfunctions.phpâ PAGE with the SMS API
My major problem is that, the SMS is sent but the page refuse to redriect to ââhome.phpââ
so i think, after redirection to the SMS API, Its will also redirect back to my Home.php. but it only redirect to the SMS API then stop there.
That has been my challenge with it
I understand, what iâm saying is that you call the SMS API separately(i.e donât use the header function for that) and then redirect to wherever u want on success . U can check out the guzzle php library, if you are finding it hard, It makes consuming APIs easy in PHP.
I will advise you to use twilo instead https://www.supremo.tv/insights/basic-php-integration-twilio-sms/