binladun
June 23rd, 2003, 01:58
Hi !
This is my HTML code - file name "form.html"
<html><body>
<FORM method=POST action=script.php>
<input type=hidden name="abc" value="value_abc">
<input type=hidden name="def" value="value_def">
<input type=hidden name="xyz" value="value_xyz">
<input type=submit value=Submit>
</FORM>
</html></body>
I've wrote the "script.php" which can print to browser like this
abc|value_abc
def|value_def
xyz|value_xyz
This is what I have done - "script.php"
<?php
print "abc|$abc<br>def|$def<br>xyz|$xyz";
?>
And now - I need your help to write an advance "script.php"
I want that if I go to modify "form.html" -
change the field name "abc" to "new_abc" and new value for that field (see below)
<input type=hidden name="new_abc" value="new_value_abc">
<input type=hidden name="new_def" value="new_value_def">
<input type=hidden name="new_xyz" value="new_value_xyz">
Then when I submit the form - it will print out correctly like this
new_abc|new_value_abc
new_def|new_value_def
new_xyz|new_value_xyz
Hope you understand what I mean -
The "script.php" will print out correctly field_name|field_value even if I add or remove the form field.
Thanks
This is my HTML code - file name "form.html"
<html><body>
<FORM method=POST action=script.php>
<input type=hidden name="abc" value="value_abc">
<input type=hidden name="def" value="value_def">
<input type=hidden name="xyz" value="value_xyz">
<input type=submit value=Submit>
</FORM>
</html></body>
I've wrote the "script.php" which can print to browser like this
abc|value_abc
def|value_def
xyz|value_xyz
This is what I have done - "script.php"
<?php
print "abc|$abc<br>def|$def<br>xyz|$xyz";
?>
And now - I need your help to write an advance "script.php"
I want that if I go to modify "form.html" -
change the field name "abc" to "new_abc" and new value for that field (see below)
<input type=hidden name="new_abc" value="new_value_abc">
<input type=hidden name="new_def" value="new_value_def">
<input type=hidden name="new_xyz" value="new_value_xyz">
Then when I submit the form - it will print out correctly like this
new_abc|new_value_abc
new_def|new_value_def
new_xyz|new_value_xyz
Hope you understand what I mean -
The "script.php" will print out correctly field_name|field_value even if I add or remove the form field.
Thanks