I'm trying to use PHP to set up some pages on our company intranet that can be easily maintained by various department heads who have no HTML abilities.
Using two files -- 1. an HTML form for input and file uploads 2. a PHP "action" page that takes variables from the form, as well as images uploaded thru the form, and formats them into a nice HTML layout.
I have sucessfully passed variables and files from the forms to my php page, which being a designer by trade, I am MOST proud of. My problem is that, of course, the only way to view the page is to fill out my form!!! Arrrrgh......
My question is this: How do I take this page that the designated person has filled out and thus edited, and make it viewable on my intranet for everyone else????
Is my best bet to write from a form to a txt file and then pick up my variables??
My "code" is below, and thanks in advance for any help!
MY FORM
###########################
<form name="contentform" method="post" action="output.php" enctype="multipart/form-data">
<table width="50%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<center>
Type your headline:
</center>
</td>
<td>
<input type="text" name="headline">
</td>
</tr>
<tr>
<td>
<center>
Type your content:
</center>
</td>
<td>
<textarea name="content" wrap="VIRTUAL" rows="7"></textarea>
</td>
</tr>
<tr>
<td>
<center>
Add an image:
</center>
</td>
<td>
<input type="file" name="uploadedfile">
</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" name="Submit" value="Update">
</td>
</tr>
</table>
MY PHP
###########################
<?
echo "<p><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\" color=\"#999999\"><b>$headline</b></font></p>";
if ($img1_name != "") {
@copy("$img1", "D:/MY/FILE/UPLOAD/PATH/$uploadedfile_name");
echo "<p><img src=\"images/$uploadedfile_name\" align=\"left\">$content</p>";
} else {
echo "<p>$content</p>";
}
?>