NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page php filter problem

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 08-16-2008, 08:27 PM THREAD STARTER               #1 (permalink)
Senior Member
 
Dean's Avatar
Join Date: Jan 2007
Location: Melbourne
Posts: 1,714
Dean has much to be proud ofDean has much to be proud ofDean has much to be proud ofDean has much to be proud ofDean has much to be proud ofDean has much to be proud ofDean has much to be proud ofDean has much to be proud ofDean has much to be proud of
 


Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009

php filter problem


I could swear this was working before but all of a sudden it isnt.

PHP Code:
$int_options = array(
        
"options"=>array
        (
        
"min_range"=>-1000000000,
        
"max_range"=>1000000000
        
)
      ); 
PHP Code:
elseif(!filter_var($_GET["min"], FILTER_VALIDATE_INT$int_options))
????: NamePros.com http://www.namepros.com/programming/504511-php-filter-problem.html
        {
        echo(
"Range is between -1000000000 and 1000000000");
        }
      elseif(!
filter_var($_GET["max"], FILTER_VALIDATE_INT$int_options))
        {
        echo(
"Range is between -1000000000 and 1000000000");
        } 
The problem is that it thinks 0 is either not a valid integer or not in the range -1000000000 and 1000000000 because it enters the elseif statements. Any ideas? If you need more of the code just tell me.
Dean is offline  
Old 08-17-2008, 05:46 AM   #2 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,069
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
Not going to be able to help much without seeing all the relevant code.

However the most likely cause is the fact 0 is boolean for false.
__________________
Manage your portfolio using my new Domain Portfolio Management script.
Securing Your Domain Name From Theft
Peter is offline  
Old 08-18-2008, 12:14 AM THREAD STARTER               #3 (permalink)
Senior Member
 
Dean's Avatar
Join Date: Jan 2007
Location: Melbourne
Posts: 1,714
Dean has much to be proud ofDean has much to be proud ofDean has much to be proud ofDean has much to be proud ofDean has much to be proud ofDean has much to be proud ofDean has much to be proud ofDean has much to be proud ofDean has much to be proud of
 


Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
Exactly what I was thinking as I had a similar problem with checking for a valid boolean input but I sorted that out. What troubles me with this is that I am 99% sure the code was working before.

Will have a look later and see what other code might be relevant and post it but I think thats the main bit since it returns "Range is between -1000000000 and 1000000000" when either min or max is 0.
Dean is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 08:27 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger