i noticed that when posting a form the fields come out as an array.
like if i do
if(isset($_POST['submit'])) {
print_r($_POST);
}
what i usually do for form fields is the following.
lets say i have something like this (this is how i usually do it)
<form method="POST" action="">
<label>First Name: </label>
<input type="text" name="fname">
<label>Last Name: </label>
<input type="text" name="lname">
<label>Phone: </label>
<input type="text" name="phone">
<input type="submit" name="submit" value="submit">
</form>
then i'll have (im excluding field validation to make it look clear)
if(isset($_POST['submit'])) {
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$phone = $_POST['phone'];
mysql_query("insert into table(fname,lname,phone) values('$fname','$lname','$phone')");
header("Location: gosomewhere.php");
}
since the post outputs are in an array format how else can i write this when im dealing with over 100 fields?
how are the big guys doing it out there? or how are you doing it?
edit: the most ive dealth with is around 60 fields. im building this cms that takes in alot of data per form to put together information from a customer.