Hello,
I use ctype() to filter and validate a user form. However, I am trying to allow certain characters.
Example:
Code: //Validate Copay
$allow = array('$', '.');
if (!empty($copay) && strlen($copay) < 6 || strlen($copay) > 8) { // IF copay is not empty and not between 6 and 8 characters
$error .= 'COPAY has a maximum of 8 characters. An example of a maximum $0000.00, and a minimum $00.00.<br />';
$output_form = true;
}
if (!empty($copay) && !ctype_digit(str_replace($allow), '', $copay)) { // IF copay is not empty and contains illegal characters (Allow $ and .)
$error .= 'COPAY contains illegal characters.<br />';
$output_form = true;
}
With this example, my test comes back containing illegal characters. I've tried changing it here and there, but get the same results. Thank you!
form variables from database help.
Hi all,I would like to have a form that gives you options based on the results of an mysql query.My example is this, say I have a mysql row with the colum name points and the result is 5. How would I
Check before inserting in DB ???
This is my code--------------- if ( $_POST ['Submit']){{$username = $_POST ['usernm'];$userpassword = $_POST ['userpw'];}/*insert data from the form into the db table*/ $querypost = mysql_query
Need Help with a query
Hello, For some reason I am just not getting the right answer when I do this query and not quite sure why? $runinposition = mysql_query("SELECT * FROM bb_off WHERE user='$user' AND test1='test1'
Inserting multiple records from single form
I've found a number of threads that deal with this issue, but I'm new to php and coding language so I don't quite understand what they're talking about or what the code means.Here's the situation: I
Hi, explode and strstr.
Hi, I seem to be confused about the strstr function, eg. i have a string like:"a.b.c.d.e.f""a.b.c.d.e"I always want it to split at the second "." from the end, so
Buggy registration system
Hey, I just started scripting in PHP, and I ran into a few problems.Code: <?phpinclude('config.php');if
Aris, Netweaver BPM, Visual composer and X'app
Dear Experts,
Revoking alter any table from a schema
Hi All,
Progress bar tracking file downloads
Hey guys, was wondering if there was a way to track how far a file has been downloaded. I know there is a way to track uploading with APC and php 5.2 + ?? any suggestions thanks
multipart emiail forms
Hi All, I am new to the boards and I've been working on a form (which is rather massive, imo) and i've been looking online at other peoples php examples for multipart emails. The code i am using /