I have a for with multiple test input fields. Specifically the user submits multiple names and ages. The form is submitted using the POST method. Here is a code snippet:
Code:
<form action = {$_SERVER['PHP_SELF']} method = 'post' >
for($i=1; $i<=10; $i++){
<input type = 'text' name = 'name[]' size ='25' maxlength = '50' />
<input type = 'text' name = 'age[]' size ='25' maxlength = '50' />
}
<input type="submit" />
</form>
I want to check if the user clicks submits without entering values in the text fields.
I have tried this:
Code: if(empty($_POST['name']) && empty($_POST['age'])){
echo "All the entries were blank, please enter name(s) and age(s) on the left and click submit. Thank you.";
}
However, this doesn't parse as "true" when I click submit with the fields empty.
Is it not possible to use "empty()" with arrays and/or multidimensional arrays?
Blogging s/w
heya frndz!!! i want to start a blog.... m looking for a s/w like oscommerce which is thr for e-comm websites... so can u please suggest me some s/w through which i can set up the blog... thnx in
registration form
first time posting. did some searches but didnt find exactly what i am looking for. dont flame cause i am posting in the wrong area. I am starting from scratch with a new registration form for a
User feedback after MySQL query has been executed
Hi all, I've just registered on PHPFreaks because I've got a question that I simply can't work out by myself.Im developing a web based reporting application, based upon PHP/MySQL. At some point the
C++ Http request?
Code:
Keep newlines from textarea?..
I'm creating a simple encoding program, and what I want it to do is retain the newlines, as echoing a textarea for example will strip them out (I think). How do I retain the \n's or whatnot and place
All possible combinations of Strings from table in PL/SQL
Hi,
blank page.... nothing is happening.
I'm new to a lot of this but in the last 24hrs have learned a lot.Installed latest version of mysql... went fine no problems.Installed latest version of php... went fine no problems.did all my
SESSION CHECK WORKS "MOST" of the time... whats going on?
i have a sign in check thats included in every page that is a members only page which is basically all of my pages. that im working on anyways..but heres the code..... that works MOST of the time.
Mysql query, two times?
Hello to all,I'm new to php coding and i like it alot. I need help with some noob stuff.1. Having problem with mysql query after submiting HTML form. It's allways execuding two times, that way i have
I face problems to extract data from one table and insert it in another one
Hi,