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?
subtract 1 from value entered in text field
HiHow do I subtract 1 from the vaue entered into a text field?Thanks
How to know if online site made with PHP
Hello,I see some sites that does not display extensions at all , for example:www.site.com/login (for login page)but how I can know the language used in this site ?Thanks
FTP Programs
Here is a list of commonly suggested FTP Programs to use:FileZillaSmartFTPCuteFTPRightFTPCoreFTPJFTPFireFTP
weird problem
last time, i did post a topic concerning why my page sometime will load as blank page when using IE. someone has told me that it might be my hosting server problem, too slow...but, now after testing
Login logout link help
Hi all,Im new to php and Im having trouble creating a login/logout link for my page that displays as: Log Out | My Account.when a member is signed in, And: Log In | Sign UpWhen no one is signed in.The
Limiting uploaded file type
I am working on a simple upload script, and I need it to limit the allowed file type that is uploaded to only .mpr files. .mpr files are not a MIME file type so I do not know how to limit it. Any
Display certain image depending on time of year
Hi, I am new to these forums and would really appreciate some advice on a piece of coding I have done.Basically what I am trying to do is on our intranet, display a different home page banner
mod_rewrite.c on windows ??
why it's not working on windows while it's working on other hosts??? this is the code i got from a tutorial :Code: [Select]<IfModule mod_rewrite.c>RewriteEngine OnRewriteBase
Linkage between two scripts
Okay say I have this for a link in a script:Code: <li><a href="#" onclick="ajaxpage('bio', 'content'); return
Undefined index on my form
ok im getting Undefined index on this line.. print_r($_REQUEST['form']);below is the full script its formCode: <?phpini_set("display_errors",