Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Make sure user inputs a denomination of 500

Posted on 2012-08-24
2
Medium Priority
?
463 Views
Last Modified: 2012-08-24
Hi,

I have a field which a user will fill out to bid on an item, however I need what they enter to be a denomination of 500.

At the moment I have it working so that the amount the user enters has to be more than the current bid amount in the database.

if ($amount > $row_RSproperty['propCurrBid'])

Open in new window


How do I go about making sure what they put is a denomination of 500?

Thanks,

Chris
0
Comment
Question by:djfenom
2 Comments
 
LVL 11

Accepted Solution

by:
Slimshaneey earned 2000 total points
ID: 38328578
Simple. Use the mod operator to check if there is a remainder like this:

if ($amount > $row_RSproperty['propCurrBid'] and $amount % 500 == 0)
0
 

Author Comment

by:djfenom
ID: 38328587
I knew it would be simple!

Thanks,

Chris
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses
Course of the Month20 days, 21 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question