Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8310631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:31:47+00:00 2026-06-08T19:31:47+00:00

I am using a 3rd party sms gateway to send clients a text message

  • 0

I am using a 3rd party sms gateway to send clients a text message when a prospect submits an inquiry form on their web page. I’m using Aweber for the autoresponder system, who sends a query string with the prospect data in it, which I collect and send to the client, along with a text message to his cell phone.

I have everything working. However, I need to prevent the client from receiving multiple text messages from the same prospect within that same session, caused by refreshing or hitting the BACK button on the browser.

Here is the code I’m using, which is working, except for this issue:

   $name      = $_GET['name'];
   $email     = $_GET['email'];
   $address   = $_GET['address'];
   $phone     = $_GET['phone'];
   $phone_sms = preg_replace('/^1|\D/', "", $phone);

   $message   = "$name, $email, just submitted an inquiry for $address";

   $from      = "1212121212";   // Ph# txt message is received from
   $to        = "$phone_sms";   // Ph# txt message is sent to

   $url       = 'http://domain.com/of/api';

   $fields = array(
     'from'     =>urlencode($from),
     'to'       =>urlencode($to),
     'message'  =>urlencode($message),
   );

   foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
   rtrim($fields_string,'&');

   $ch = curl_init();

   curl_setopt($ch,CURLOPT_URL,$url);
   curl_setopt($ch,CURLOPT_POST,count($fields));
   curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);

   $result = curl_exec($ch);

   curl_close($ch);

Thanks much for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T19:31:50+00:00Added an answer on June 8, 2026 at 7:31 pm

    If you send a Location header to redirect to a “success” page at the end of the script you posted, the back button will not load the page twice.

    Try:

    // ... your code from the question
    curl_close($ch);
    
    header('Location: /sent.php');
    exit;
    

    Then have sent.php show the confirmation page letting them know their message was sent. If you need to send specific data from their request, add it to a session prior to redirecting and read that data from the session on sent.php.

    By sending the redirect, the browser will NOT attempt to re-post the same data again when using the back button to navigate. It will also prevent a refresh of the page (after sending the form) from trying to re-post the data again.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are using a 3rd party email relay service to send mass emails to
I'm using two 3rd party libraries, which both implement their own 2D vector class.
i am creating a web service using 3rd party wsdl that helps me in
I am using a 3rd party component which creates settings files based on hard-coded
I'm using a 3rd party api to request balances. I'm getting numerous errors on
In my current project I am using a 3rd party library which has no
I'm new to threads. I'm using a 3rd party library that uses threads which
My WPF test app (very simple, just one window) is using a 3rd party
My client is using functionality from 3rd party oracle ADF applications manually. That functionality
I want to use an 3rd party library without using its header file. My

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.