Closed (fixed)
Project:
Alternative login ID & display names
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
16 Jan 2008 at 16:57 UTC
Updated:
7 Jul 2009 at 12:28 UTC
I'm need to validate Alternate Login accept only integers numbers
The function _alt_login_validate works fine with these code:
// Required
if (empty($edit['alt_login'])) {
form_set_error('alt_login', t('Alternate Login must be required.'));
}
// Only Numbers
if(!is_numeric($alt_login)) {
form_set_error('alt_login', t('The name %name must be numbers.', array('%name' => $alt_login)));
}
But this validation code don't accept integer numbers or decimal numbers:
if (!is_int($alt_login)) {
form_set_error('alt_login', t('The name %name must be integer.', array('%name' => $alt_login)));
}
What happen with this validation,
Please I need support
Thanks so much
Comments
Comment #1
hunmonk commentedyou're using the wrong function.
check out http://php.net/is_int -- you should find that instructive for your needs.
Comment #2
oemb29 commentedI don't know why and I'm not sure, but in PHP 4 is_int("23") is a string and is_int(23) is a integer, this validation fixed the problem:
Thanks hunmonk
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #4
summit commentedLooking for D6 version of the same.
greetings, Martijn