Hello all!
Just a note: I am uber new to HTML, PHP, and MySQL. Never dealt with them, nor anything besides flipping a power button on a server. Most of my programming experience deals with C++ and some Java. Trying to get a server/client(Android) thing going. Following some basic tutorials, I am fine when it comes to one on one examples. But, I need to accept multiple fields (“Forms”), with one submit button. So, naturally, I took what I thought was the correct approach, but I do not know what I am doing wrong? If I can get this information to store into an array and print to the screen, theoretically, I should be able to write script inside the loop instead of writing to a screen, input it into the database as soon as I figure out how. That will probably be later. My immediate question is, why does this not display anything?
The goal is to have everything that is entered into the fields, stored in an array, and then display each item in order on it’s own line.
Please advise:
[code]
Establishment name: <br>
Street Address:
<form name = "barAddress"
method = "post">
<input type = "text"
name = "details[]">
<br>
City:
<form name = "barCity"
method = "post">
<input type = "text"
name = "details[]">
<br>
State:
<form name = "barState"
method = "post">
<input type = "text"
name = "details[]">
<br>
Zip:
<form name = "barZipCode"
method = "post">
<input type = "text"
name = "details[]">
<br>
<input type = "submit"
name = "details[]"
value = "Submit">
</form>
<?php
if (!empty($_POST['details[]']))
{
print "\n";
print "Now, lets see if this shit works...";
print "\n";
$x = 0;
while ($x < 6)
{
print "$details[$x]";
print "\n";
$x = $x + 1;
}
}
?>
[/code]
I apologize if the style is a bit weird... Thanks in advance for the help!