Your question, your audience. Choose who sees your identity—and your question—with question security.
<?php // action script
error_reporting(E_ALL);
session_start(); // if needed
echo "<pre>";
var_dump($_POST);
echo "</pre>";
// REST OF PAGE GOES HERE
<?php error_reporting(E_ALL);
if (isset($_POST['fp'])){
$arrValues = array();
foreach( $_POST['fp'] as $list_id => $values ){
foreach( $values as $k => $v ){
$arrValues[] = $list_id.', ' .$v;
echo '<li>'. $list_id .': '.$v.'</li><br>';
}
}
}
?>
<form action='array.php' method='post' enctype="multipart/form-data">
<label for="fullName">title 1</label><input name="fp[Title 1 is][]" type="text" id="1" value=""/><br />
<label for="email">title 2</label><input type="text" name="fp[Title 2 is][]" id="2" value=""/><br />
<label for="email">title 3</label><input type="text" name="fp[Title 3 is][]" id="3" value=""/><br />
<input type="submit" value="Register" id="submit" />
</form>
.
<?php error_reporting(E_ALL);
if (isset($_POST['fp'])){
$arrValues = array();
foreach( $_POST['fp'] as $list_id => $values ){
foreach( $values as $k => $v ){
$arrValues[] = $list_id.', ' .$v;
echo '<li>'. $list_id .': '.$v.'</li><br>';
}
} echo "The name and value of the form input field is:";
// this should echo Title 1 is : the value of the fleid
echo "<pre>";
var_dump($_POST);
}
?>
<form action='array.php' method='post' enctype="multipart/form-data">
<label for="fullName">title 1</label><input name="fp[Title 1 is][]" type="text" id="1" value=""/><br />
<label for="email">title 2</label><input type="text" name="fp[Title 2 is][]" id="2" value=""/><br />
<label for="email">title 3</label><input type="text" name="fp[Title 3 is][]" id="3" value=""/><br />
<input type="submit" value="Register" id="submit" />
</form>
.Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
From novice to tech pro — start learning today.
http://www.laprbass.com/RAY_temp_neil_bradley.php
Open in new window