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?
Problem with variable declaration in switch statement
Hello, I am having some trouble assigning a value to a variable inside a switch statement. What I am trying to do here is trip an error if the user has already added an item in the shopping cart.
A problem with my GD class
Hello,I created a nice (and simple for now) GD class.The problem is , it works great on wamp, but not in my hostgator acount ( Linux )i tried it on byethost and it didnt worked as well.I am posting
Passing vars to the DB
I have 3 small testing tables:ID TYPE1 pepperoni2 C. bacon3 tacoID TYPE1 small2 med3 largeID TYPE1 bud2 hef3 mil best4 7up5 orange6 cokeEach one is a select menu. How would I pass these as
DYNPRO_FIELD_CONVERSION
Hi gurus,
passing data from one page to another
hey guysi have the follwoing code to get information from one page and place on another:(1st page) page to get info from:Code: <?php session_start();$_SESSION['data'] = "blah blah
PDO returns erroneous columns from within pdt
Hi All,This is a truly weird behavior:When using a simple pdo fetch, erroneous columns are returned!Steps to reproduce:------------------------------------------------------------ -----------1.create
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
mysqli_fetch_assoc returns multiple arrays, how to return a single array
Hello, I am using mysqli_fetch_assoc which is returning multiple rows, so it looks like:Code: [Select]while($row = mysqli_fetch_assoc($result)) { print_r($row);}But this returns multiple arrays
Read from forum
Haven't written anything forever and I would like to get back.What I'm trying to do is getting the data from all the threads in a sub forum.Can someone roughly point out which functions I'll need for
mail() problem
Hi Guys,I've set up a contact email form. It sends the information fine, but it sends it to the junk folder.If I just use this command:$headers = "MIME-Version: 1.0 \n";It will send it to