View Single Post
Old 08-11-2003, 02:56 AM   #1 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,529
sde is on a distinguished road
reading a web form for input variables

i want to read in all the field names of a form to an array in php.

example of page i want to read:
Code:
<form method=post action="somepage.html">

Name <input type=text name="realname"> <br>
Email <input type=text name="email"> <br>
Comments <text area name="comments"></textarea>
</form>
i would like to read this page and read the field names into an array
PHP Code:
<?
$field
[0]="name";
$field[1]="email";
$field[2]="comments";
?>
i will read the entire page into a variable, then i think this is the pattern i need to match

input=["]?[a-zA-Z_]+["]?\s

but i am not sure how i would bring all those matches into an array.
__________________
Mike
sde is offline   Reply With Quote