pasturepool Posted February 29, 2008 Share Posted February 29, 2008 Hello, I have a form that has 3 fields: 2 text fields, 1 checkbox. I want to use a variable to define both the field NAME and default VALUE. When it comes to the field NAME, here is what I've done: <?php $FIELDNAME = $_REQUEST['FGH']; //this changes based upon a URL variable $VALUEXYZ = "ABC"; ?> <input name="<?php echo $FIELDNAME;?>" type="text" id="score" value="<?php echo $VALUEXYZ;?>" size="4" maxlength="2" /> 1. When looking at the 'input name', assuming this is correct, i'm having trouble passing this form field name to an UPDATE statement. I'm not sure how to $_POST['???'] correctly the form field name? If this made any sense to anyone out there, I am at a loss and appreciate your expertise!!!! ??? Link to comment https://forums.phpfreaks.com/topic/93602-using-variable-as-a-form-field-name/ Share on other sites More sharing options...
cyber_ghost Posted February 29, 2008 Share Posted February 29, 2008 try using a variables which you can predict the username...... or by looping it... so that you can retrieve it after submitting the form... Link to comment https://forums.phpfreaks.com/topic/93602-using-variable-as-a-form-field-name/#findComment-479644 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.