i want to place the contents of values from a form into a text file. When an option is changed in the form and submit button is clicked, the user is taken to another page where info about the company's address, website and so are displayed line after line like so:
Member Search Results:
Company
800-555-555
Address Line 1
Address Line 2
Website: http://example.com
Though the text file shows up blank. How do i go about achieving my desired result?
My code i tried originally:
<html>
<form action="http://*****.com/business_detail_framed.asp" method="post" name="b1">
<Select Name="select_business" onChange="b1.input1.value=b1.select_business[this.selectedIndex].text">
<option value="5102" name="float">Company One</option>
<option value="5053" name="float">Company Two</option>
<option value="5091" name="float">Company 3</option>
</select>
<input value="Submit" type="submit" onchange="this.form.submit()">;
</form>
<?php
file_put_contents("businessinfo.txt", $_POST['float'], FILE_APPEND);
$g = file_get_contents("businessinfo.txt");
echo $g;
$r = $_REQUEST['float'];
$r .= $_POST['float'];
echo $r;
?>
And the code i tried with a little help, but still no luck, the text file still shows up empty:
if (isset($_REQUEST['Submit'])) {
file_put_contents("businessinfo.txt", $_REQUEST['select_business'] . "\n", FILE_APPEND);
Any suggestions?