Trying to get form input passed across multiple pages and write it all to file at the end.
Getting all confused from all the books and documentation I've waded through.
Super simple script to use as template. Three pages...
Page one...
first form
<form action="data.php" method="post">
First Name
<br>
<input type="text" name="f_name" size="25">
<br>
Last Name
<br>
<input type="text" name="l_name" size="25">
<br>
<input type="submit" name="submit" value="Submit">
</form>
Page 2...
data.php
<?php
session_start();
$f_name=$POST['f_name'];
$l_name=$POST['l_name']; // Probably don't need these lines?
$session['f_name'] = $post['f_name'];
$session['l_name'] = $post['l_name'];
echo $f_name;
echo session_id();
$fp = fopen("test.txt", "w");
session_encode(); /???
echo "
<html>
<head>
<title>Untitled</title>
</head>
<body>
<form action='data2.php' method='post'>
<input type='text' name='test' size='20'>
<input type='submit' name='submit' value='submit'>
</form>
</body>
</html>";
?>
Page 3...
data2.php
<?php
session_start();
$session['test'] = $post['test'];
$session['f_name'] = $post['f_name'];
$session['l_name'] = $post['l_name'];
echo session_id();
echo $f_name;
$fp = fopen("test", "w");
session_encode();
fputs($fp, session_encode()); // following example from book
fclose($fp);
As you can see this is a train wreck and I am lost.
I want to write $f_name, $l_name, and $test to text file (and format it to a certain extent).
Thanks for helping me clear this up.