Hi
Please help me out here.
I'm trying to get this script to pull the text from a htm file to a form, then take the edited text from the form and to save it back to the same file. At the same time I'm trying to use a variable named $page to replace the actual page name so i could dynamically change the pages i want to update.
Here's the problem:
Everything works until I'm going to hit the save button. it comes back as the variable. but I want it to come back as the page that was just updated. and it's not saving it
Here's the code:
if(@$_POST["save"] == "true")
{
$fileContent = $myForm->GetValue(false);
$fp = fopen("$page.htm", "w");
fputs($fp, $fileContent);
fclose($fp);
echo "Your '$page' page is saved!<br><br><a href='$page.htm'>Continue</a>";
}
else
{
$fp = fopen("$page.htm", "rb");
while(!feof($fp))
{
$data .= fgets($fp, 1024);
}
$myEWP->SetValue($data);
//And here's the submit button:
<form action="$page.htm" method="post">
<input type="hidden" name="save" value="true">
<input type="text" name="textfield">
<br><input type="submit" value="Save">
</form>
Please help.
Thanks so much in advance.