0

This should be a rather simple question to answer. I want to include a field of data using $_POST that is not inputted by the user in an <input name=" "> text box. Is there anyway to manually add a field to $_POST without using input?

Example:

<form action="<? echo $HTTP_SERVER_VARS['PHP_SELF']; ?>" method="post">
<table align="left" border="0" cellspacing="0" cellpadding="3">
<tr><td>
<tr><td>Account Type:</td><td>One</td></tr>
//is this possible?
//<?echo $_POST['type'] = 1;?>
<tr><td>Username:</td><td><input type="text" name="user" maxlength="30"></td></tr>
<tr><td colspan="2" align="right"><input type="submit" name="subjoin" value="Submit!"></td></tr>
</table>
</form>

Edited by Encrypted: n/a

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by Encrypted
0
<input name="hiddenfield" type=hidden value='somevalue'>

User will not able to view the field but still it will be posted along with other form elements.

Edited by urtrivedi: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.