By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,830 Members | 2,271 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,830 IT Pros & Developers. It's quick & easy.

is_numeric and MAC input

P: n/a
Hi,
My MAC users (2 so far, unknown OS versions) complain that my code
always fails here saying
From: les
Subject: Bugs
Message: Hi John, I couldn't get it to work! It didn't seem to
recognize my numbers as numbers. Is this because I am on a Mac (gasp)?
Les

Other users do not have this problem.

Any idea why this function would fail?

First we get the data:

$doag=$_GET['DOAG']; check100($doag, "doag");

Here is the function call. It should check for a valid number, then,
if it isn't valid, find the agency the user submitted and tell them
they need to send a number.
function check100($x, $ag) {
if (!is_numeric($x)){
mysql_connect("localhost","dbname", "passwd");
mysql_select_db("dbname");
$query = "select agency from agency where agency_id = '$ag';";
$result = mysql_query($query) or die("Error, agency query
failed");
while ($row = mysql_fetch_array($result))
{ $ag = $row['agency']; }
$e_code[6]=$e_code[6] + 1;
print "The value in $ag is not a number, please try again.";
}

================================================== ============
My server runs

Apache/1.3.37 Ben-SSL/1.57 (Unix) mod_gzip/1.3.26.1a mod_fastcgi/2.4.2
mod_throttle/3.1.2 Chili!Soft-ASP/3.6.2 FrontPage/5.0.2.2635 mod_perl/
1.29 PHP/4.4.6

Operating System
Name: Linux
Vendor: Debian
Version: CustomLinux

PHP Version: 4.4.6

MySQL Version: 5.0.30

Apr 24 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.