The code is an HTML form that outputs an HTML page for ease of others use. The text portion of the form vary in number of characters. I am trying to have the Submit use fwrite to write to a txt file and then have the php "output" page fread the output txt file. New to php and well out of practice my mind is gone, I now think creating an array and replacing strings is the best way to go and have the submit write to the php, Ive added "default" blocks to the form in an my thought to accomplish the overwrite.
The original code that goes nowhere near accomplishing it
Snipet of the Output
<?php
$t1image = $_POST["t1image"];
$t1title = $_POST["t1title"];
$t1info = $_POST["t1info"];
$t2image = $_POST["t2image"];
$t2title = $_POST["t2title"];
$t2info = $_POST["t2info"];
?>
...
<tbody>
<tr><!--Headers-->
<td style="vertical-align: top; text-align: center; background-color: rgb(204, 255, 255);">Animal</td>
<td style="vertical-align: top; text-align: center; background-color: rgb(204, 255, 255);">Image thumb<br>
</td>
<td style="vertical-align: top; text-align: center; background-color: rgb(204, 255, 255);">Date<br>
</td>
<td style="vertical-align: top; text-align: center; background-color: rgb(204, 255, 255);">Information<br>
</td>
</tr>
<tr>
<td style="vertical-align: top; text-align: center;">Monkey
</td>
<td style="vertical-align: top; text-align: center;"><img src="<?php echo $t1image.'.gif'; ?>"><!--single image presented selected from radio buttons-->
</td>
<td style="vertical-align: top; text-align: center;"><?php echo date("m/d/Yh:i A"); ?><!--time stamp generated when submitted form populates all fields at once-->
</td>
<td style="vertical-align: top; text-align: center;"><a href="#monkey" rel="facebox"><?php echo $t1title ?></a><!--Link name provided by "Title 1", that links to hidden Div generated page with content from "Info1" field-->
<div id="Monkey" style="display:none">
<?php echo $t1info; ?>
</div>
</td>
</tr>
<tr>
<td style="vertical-align: top; text-align: center;">Cat<br>
</td>
<td style="vertical-align: top; text-align: center;"><img src="<?php echo $t2image.'.gif'?>"></td>
<td style="vertical-align: top; text-align: center;"><?php echo date("m/d/Yh:i A"); ?></td>
<td style="vertical-align: top; text-align: center;"><a href="#Cat" rel="facebox"><?php echo $t2title ?></a>
<div id="Cat" style="display:none">
<?php echo $t2info; ?>
</div>
</td>
</tr>
<tr>
The above Code actually replicates 15-20 times...you get the point
Snipet of the Input Form and where I choke
<form action="animals.php" method="post"> <div style="text-align: left;"><big style="font-family: Garamond; font-weight: bold; color: rgb(51, 51, 255);"><big><big><span>Monkey</span></big></big></big><br> <table style="text-align: left; width: 110px;" border="0" cellpadding="2" cellspacing="0"> <tbody><tr> <td style="vertical-align: top;">Image thumb<br> <input type="radio" name="t1image" value="No opinion" checked><img src="eh.gif" alt="Eh"> <input type="radio" name="t1image" value="Ok"><img src="ok.gif" alt="ok"> <input type="radio" name="t1image" value="Like"><img src="like.gif" alt="Like"> <input type="radio" name="t1image" value="Dont"><img src="dont.gif" alt="Don't Like"> <input type="radio" name="t1image" value="Hate"><img src="hate.gif" alt="Hate"> <input type="radio" name="t1image" value="Other"><img src="other.gif" alt="Other"> <br> Why Title:<input type="text" name="t1title" size="45" value="..."/></td> <td style="vertical-align: top;"> Explain:<br> <textarea name="t1info" cols=45 rows=3 value="..."></textarea> </td></tr></table> <br> <!--Next-->
Again it also replcates multiple times
Can anyone make a suggestion of the best way to tackle this, which would allow another user to open the animal.php from the server and seen the last posted form.
I don't need to keep the data from previous posts, not have the enviroment. I'm not entirely sure how or what the code would look like.
Thank you

New Topic/Question
Reply



MultiQuote





|