Possible Duplicate:
Remove submit button value from $_POST form data PHP
I want to echo the names of the text inputs, but this also echos the submit input name, how can I change it so that it ony selects inputs with type=”text” in them?
<?php
if(isset($_POST['submit'])){
foreach( $_POST as $value){
echo $value;
}
}
?>
<form action="ajax.html" method="POST">
<input type="text" name="a">
<input type="text" name="b">
<input type="text" name="c">
<input type="submit" name="submit">
</form>
POST doesn’t know how the data was gathered. The only way you could do this is like so: