Hi there
I am trying to make a very simple form validation function. I currently have the following
function formValidate($field, $msg) {
if (empty($_POST['$field'])) {
$errors[] = $msg;
} else {
$field = mysqli_real_escape_string($dbc, trim($_POST['$field']));
}
}// end of function
formValidate('form', 'You forgot to enter the form');
When I run the script and enter nothing into the $_POST['form'] field it still executes an empty record into the database.
What am I doing wrong?
how do i make a string??
hey guys,can someone please tell me how to put data from the glob function into a stringthanks
php calculate
this code echoes correctly the sum but the inserted result is 0??Code:
Help with some dates
I have a list of dates in an array:$mondays = array( strtotime("October 12, 2009"), strtotime("October 19, 2009"), strtotime("October 26,
unoconv doc convert to pdf code prob
PHP/5.3.1 Hi. I am trying to use this code to convert docs to .pdf utilizing unoconv. However the page just freezes blank, with no php errors reported. All permissions to folders are set 777. Can
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
str_replace help
Hey there,I'm a PHP newb, I'm having troubles with the str_replace function. I want to clean up bad html to valid xhtml, I am using:Code: $pee = str_replace('&', '&', $pee);It
WELCOME SCREEN
first of all let me tell you what does my script do, it´s a very simple query to show a email from a database, (EX: Welcome: user@server.com). i get the email whit the id.
Multi-user card game
I'm writing a batch of games and such. Lottery is finished, Poker,blackjack,etc are next. They will be multi-user. I've got the multi-deck shoe and dealing table done and other parts rough coded. What
Match stored value with the current value in a loop
Hello,I have a MySQL db were I store articles in.I have a form to fill these articles, and in that form I can select images who are stored into a directory. Selecting the images works good but the
foreach help.
Hello all,First time I'm attempting to use a foreach statement and was just wondering if my code is correct:Code: $sql = "SELECT email from mail_list where subcribed = \"Y\" ";