For the past 2 days I've been struggling on writing a PHP script that takes info entered into a form that then gets posted to a seperate file. This is the form code:
Code: Select all
<form id="Form" name="Form" method="post" action="writer1.php">
<input name="filename1" type="text" class="textfield" id="filename1" />
<input name="filedescription1" type="text" class="textfield" id="filedescription1" />Code: Select all
<?php
$filename1 = $_POST['filename1'];
$filedescription1 = $_POST['filedescription1'];
$my_file = "inter.php";
$fh = fopen($my_file, 'a') or die("can't open file");
$string_data1 = "$filename1";
$string_data2 = "$filedescription1";
fwrite($fh, $string_data1);
fwrite($fh, $string_data2);
echo "File successfully written";
?>Code: Select all
<?php
$var1 = html_entity_decode($string_data1);
$var2 = html_entity_decode($string_data2);
?>Code: Select all
<table align=center width=100%>
<tr><td>$var1</td><td>$var2</td></tr></table>Code: Select all
<?php
$var1;
echo "<br>";
$var2;
?>