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 6619663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:59:53+00:00 2026-05-25T20:59:53+00:00

I have a simple promo code script to apply a discount to an amount

  • 0

I have a simple promo code script to apply a discount to an amount before it is passed to Paypal, it works fine but I want to use a number of different codes so I can monitor their performance (all give the same discount).

At the moment I have:

if($_POST[‘promoCode’] == “ABC123”)

This allows me to use one code – I would like the letters to remain the same but allow a range of numbers, from maybe 001 to 999.

Looking forward to a reply from you good people, this site has been such a great resource for me over the last twelve months just from reading answers to other people’s questions, however I couldn’t find one that related to my specific issue.

Thanks in advance!

Scott.

  • 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-05-25T20:59:54+00:00Added an answer on May 25, 2026 at 8:59 pm

    Thanks @M42

    if(preg_match('/^ABC(\d{2}[1-9]|\d[1-9]\d|[1-9]\d{2})$/', $_POST['promoCode'])) {}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have simple HTML code with some JavaScript. It looks like: <html> <head> <script
i have simple question may be someone asked it before me but i could
I have simple code: <?php error_reporting(E_ALL); ini_set('display_errors', true); ini_set('html_errors', false); $test = array(); $test
I have simple JSF2 application running on glashfish 3.1. I want to add a
I have simple front controller plugin which contains this code: http://pastebin.com/m155c59b0 When session expire
I have simple code : URL url; BufferedReader in = null; HttpURLConnection connection; InputStream
I have simple code that does a head request for a URL and then
I have simple query, but when I'm trying to execute this query I'm getting
I have simple app in my project. This app works without any problem. I
I have simple code that uses AudioUnit to render sine wave to the output.

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.