Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-26-2003, 01:59 PM   PM User | #1
sametch
New Coder

 
Join Date: Jan 2003
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
sametch is an unknown quantity at this point
Validating form inputs are integers

I am designing a form to enter values into a MySQL database.

One field in the database needs to hold integers. I would like to be able to validate that the value a user enters into the associated form text box is an integer and not a double or text.

The problem I have is all numeric entries end up being type string.

Is there an easy way to validate that a user has typed in an integer?
sametch is offline   Reply With Quote
Old 02-26-2003, 03:18 PM   PM User | #2
x_goose_x
Regular Coder

 
Join Date: Jun 2002
Location: Montreal, Canada
Posts: 644
Thanks: 0
Thanked 0 Times in 0 Posts
x_goose_x is an unknown quantity at this point
http://www.php.net/manual/en/function.is-int.php
x_goose_x is offline   Reply With Quote
Old 02-26-2003, 04:41 PM   PM User | #3
sametch
New Coder

 
Join Date: Jan 2003
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
sametch is an unknown quantity at this point
thanks I'll give it a try

that helped alot, thanks

Last edited by sametch; 02-28-2003 at 05:00 PM..
sametch is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:32 AM.


Advertisement
Log in to turn off these ads.