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 06-09-2007, 08:58 PM   PM User | #1
cruzer
New to the CF scene

 
Join Date: Jun 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
cruzer is an unknown quantity at this point
Missing PHP Functions?

I'm fairly new to PHP.

I'm trying to validate PHP variables before updating a MySQL table. Mainly to establish decimal pointys, currency, etc. I've checked on the w3schools.com site and found the following refernce to using the built-in PHP filter functions. Except, when I run them, I get an error message - "Call to undefined function filter_var() in.....". It seems that I can't get any of the preloaded functions to work but any custom functions that I write do. Is there something wrong with my code or is there something wrong with my ISP's PHP installation?

Following is the code that is placed in the body of my test page:

Code:
<?php
$int = 123;
if(!filter_var($int, FILTER_VALIDATE_INT))
 {
 echo("Integer is not valid");
 }
else
 {
 echo("Integer is valid");
 }
?>
cruzer is offline   Reply With Quote
Old 06-09-2007, 09:08 PM   PM User | #2
PappaJohn
Senior Coder

 
Join Date: Apr 2007
Location: Quakertown PA USA
Posts: 1,028
Thanks: 1
Thanked 125 Times in 123 Posts
PappaJohn will become famous soon enough
What version of php is installed?
PappaJohn is offline   Reply With Quote
Old 06-09-2007, 09:12 PM   PM User | #3
cruzer
New to the CF scene

 
Join Date: Jun 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
cruzer is an unknown quantity at this point
My PHPinfo shows it as Version 5.1.4
cruzer is offline   Reply With Quote
Old 06-09-2007, 09:16 PM   PM User | #4
PappaJohn
Senior Coder

 
Join Date: Apr 2007
Location: Quakertown PA USA
Posts: 1,028
Thanks: 1
Thanked 125 Times in 123 Posts
PappaJohn will become famous soon enough
It's not available until version 5.2.0

http://us.php.net/manual/en/function.filter-var.php

Last edited by PappaJohn; 06-09-2007 at 09:17 PM.. Reason: added link
PappaJohn is offline   Reply With Quote
Old 06-09-2007, 09:24 PM   PM User | #5
cruzer
New to the CF scene

 
Join Date: Jun 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
cruzer is an unknown quantity at this point
I guess that explains that then. Thanks.
cruzer 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 06:12 AM.


Advertisement
Log in to turn off these ads.