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!
Show message after entering data
Hello Colleagues I would like to display messages after entering the data example: " data were successfully " or " Error send data" in advance thanks.
Character Sets/Collations Stuff
Can someone please give me a check list of things I must do to setup all the charset stuff for my php/mysql social site*only for a USA town doesn't require non english characters*
Beginner question regarding Array's
Hi everyone, the page im working on has an array of variable at the top...Code: $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL, 'PRODUCT_LIST_NAME'
path to include folder
Hi everyone,When I'm testing locally, I have to add the name of the site folder as part of the path name when I'm including files, eg.include $_SERVER['DOCUMENT_ROOT'] .
Word filter problem
Hello,im trying to make a filter for words inputted in to my website but i want to store the swear word and the replacement for that word in a mysql db i have developed the code
Beginners syntax and loop questions - help please!
Hi everyone,I have some problems with php code. I'm currently in the middle of learning php, but these problems have got me stuck fast. But also have a question regarding looping that i'll ask in the
PHP mail() with images
I'm trying to get images to send along with my HTML e-mail sent through PHP mail(). I only tried viewing the e-mail through google mail and thunderbird, google mail showed the image but thunderbird
How to secure my login data to my database?
Hi there,It may be a stupid question but I don't know how to secure my login data to my database. I have created an include file in order not to have these data in the code of my pages, but I don't
need help about
i store the value of my select statement result to an array and stored it to a variable named $fname the i used it as the value of:<input type='text' name='fname' value=<?php echo $fname
login to other site by sending post variables
hey,here is my problem: my school gave me a mail account for school-stuff use. they mail us importent information like changes to the timetable. now this stupid mail account oanly has a web interface.