I am trying to write a html form so that it outputs its field data to two separate parts of a php document which then handles the data depending on which submit button has been selected. Im hoping some has a few ideas as to how I can accomplish this. Here is some code explaining what I am trying to do.
<FORM name=form action="form_data.php" method=post>
data field 1 <input type="text" name="data1" >
data field 2 <input type="text" name="data2" >
data field 3 <input type="text" name="data3" >
<input type="submit" name="Submit1" value="Submit">
<!-- if this button is clicked it should go to and run section 1 of form_data.php-->
<input type="submit" name="Submit2" value="Submit2">
<!-- if this button is clicked it should go to and run section 2 of form_data.php-->
$data1 = $_POST_VARS['data1'];
$data2 = $_POST_VARS['data2'];
$data3 = $_POST_VARS['data3'];
//here is where I dont know how to separate the data into two sections
// section 1 -- when the Submit1 button is clicked this should run
// section 2 -- when the Submit2 button is clicked this should run
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
There are times when I have encountered the need to decompress a response from a PHP request.
This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…