Re: [PHP] simple ereg question

2003-02-23 Thread Robert E. Harvey, M.D.
Ernest E Vogelsinger wrote: At 01:01 24.02.2003, Robert E. Harvey, M.D. said: [snip] if (is_numeric($_POST["gamt_$i"]) or empty($_POST"gamt_$i")) or this: if (is_numeric($_POST["gamt_$i"]) || empty($_POST"gamt_$i&

Re: [PHP] simple ereg question

2003-02-23 Thread Robert E. Harvey, M.D.
John W. Holmes wrote: I'd like to verify input data transferred from a form and make sure it is numeric data or null before my program executes. I am using this syntax, which doesn't work: for ($i=1;$i<=3;$i++) { if (ereg('[0-9]+','$_POST["gamt_$i"]')) { continue; } else { die("Non-nu

[PHP] Frustation with data validation

2003-02-23 Thread Robert E. Harvey, M.D.
First, thanks to all who offered suggestions with my "simple ereg question". I have been unable to get anything to work "properly" in spite of many good suggestions. The problem I want to solve is to ensure that input fields have either an integer number or are blank before the program procee

[PHP] simple ereg question

2003-02-20 Thread Robert E. Harvey, M.D.
Hello folks, I'd like to verify input data transferred from a form and make sure it is numeric data or null before my program executes. I am using this syntax, which doesn't work: for ($i=1;$i<=3;$i++) { if (ereg('[0-9]+','$_POST["gamt_$i"]')) { continue; } else { die("Non-numeric

[PHP] Test

2003-02-20 Thread Robert E. Harvey, M.D.
This is a test message. I sent a real message last night and apparently it didn't make it to the server. Bob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Simple ereg question

2003-02-19 Thread Robert E. Harvey, M.D.
Hello folks, I'd like to verify input data transferred from a form and make sure it is numeric data or null before my program executes. I am using this syntax, which doesn't work: for ($i=1;$i<=3;$i++) { if (ereg('[0-9]+','$_POST["gamt_$i"]')) { continue; } else { die("Non-n

Re: [PHP] An "escape special characters" problem

2003-02-15 Thread Robert E. Harvey, M.D.
Jason Sheets wrote: You're problem is that you are enclosing your value for your tags with single quotes ('), when you fetch the value from the database the single quote in 's ends the value='' assignment in your HTML. You can use echo "$algen"; which will solve your single quote problem. You

[PHP] An "escape special characters" problem

2003-02-15 Thread Robert E. Harvey, M.D.
Hi folks, I am trying to transfer data from a select list and am having problems with special characters stopping the transfer. The data is presented in a form as follows: $query = "SELECT algen FROM allist WHERE altyp = 'W' ORDER BY algen"; $result_1 = mysql_query($query) or die ("Coul

[PHP] grief with printf(), padding and alignment of text

2003-02-11 Thread Robert E. Harvey, M.D.
I'm running PHP 4.2.2 and I'm having trouble with the printf() function. I want to be able to print data in space padded fields with the alpha strings left justified and the numeric strings right justified. For some reason I can't get printf() to pad with spaces. It pads with " "-s and righ