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?
array ...
hiCode: function formatCategories($categories, $parentId){ // $navCat stores all children categories // of $parentId $navCat = array(); // expand only the categories with the same parent id
include
Hi I have this way of licensing my PHP application, and I want to know if you guys can answer some questions with it.So there is the index.php on the server of the person who bought it
generating random codes
Hi guys n gals,I have a requirement to generate 250,000 unique codes...These codes are for a tracking service and will be stored in the database (table field has a unique index).Now I am working on
Export hangs
Hi all, please helpI have a Oracle 10.2.0.3.0 database. When I want to query the dba_segments or dba_directories views Oracle just hangs, and when I do a export that hangs aswell. I did a export
Using insert variable
need a way to inert variable data to mysql database $acc = "212121212";$nok = "Nokia1100";$db_link = mysql_connect("localhost","root",
Sum of Values in an Array
This is probably really simple... but it's been years since I've written anything, so bare with me!I've got a MySQL database setup with a table that has multiple fields, where one is a numerical
Displaying Site Logo/Icon on a Title tag
really need some help out here. I want to insert a Logo/Icon just like the one close to the "PHP Freaks" title bar. But kinda finding it difficult to do that. Don't know if to echo the image
Post PHP form to non-existing page
The company that I work for host their PHP code on IIS on a Windows server, no Apache, so no mod_rewrite. I recently wrote a custom framewok that is loosely based on Codeigniter. To get SEF URL's 'n
Text Not Displaying Correctly With PHP:GD
I recently moved servers and since then I have noticed that one line of text is showing weirdly.I have attached an example image that was generated. In the word 'Managing' the letters M & N
Gaining access to Drop Down Menu Variable
code is below, I am creating a drop down menu. I want to echo the value selected in the drop down menu in the php file that is executed afterwards. when I echo frmcounty in the php file it returns