If its okay, why not include a textfile inside pre-tags or you can also put
string trough this kind of php-function
function html_inclusion($file)
{
- open that file into string
- put string trough htmlspecialchars (maybe do striptags first)
- str_replace \n with <br>
- echo that string
}
then they can use ftp to update that textfile
I use www.mamboserver.com for my personal site (see signature).
Its a Content Management System based on PHP.
Mambo allows for website content to have a start date & end date. So a new
question would appear at the appropriate time
gtoomey
www.gregorytoomey.com
"Gregory Toomey" <nos...@bigpond.com> wrote in message
news:2n94fkF...@uni-berlin.de...
I would allow this form just to write to a text file, and the webpage can
just pull the content from the text file using PHP or server-side includes
or whatever you have at your disposal.
--
Steve
"Steve" <st...@somewhere.invalid.com> wrote in message
news:zxJPc.21058179$Of.34...@news.easynews.com...
>hi all
>i need to have a page on a clients site that has a competition question that
>changes weekly.
>they need to be able to change the question through some kind of admin page
>(i was going to make a separate page that was password protected for this
>purpose).
>now i am thinking using MySQL etc will be like using a sledghammer to crack
>a nut open,
Maybe, but you could do other cool stuff like put in a load of
questions and having them change each week automatically. I've used a
database for a list of events and found it worth its weight in gold.
Set it and forget it. Of course you can charge the client for weekly
updates..:-)
But if you just want to write to a text file, I posted a script a few
days ago that allows you to do just that. You'll have to hack it a bit.
www.ckdog.co.uk/logger/display.php
To edit the file:
http://www.ckdog.co.uk/logger/editlog.php
Let me know if you want it.
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
> i need to have a page on a clients site that has a competition question that
> changes weekly.
Do you also need to collect the answers to the competition? Or are those
collected by e-mail or something?
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Now Playing ~ ./dido/life_for_rent/02_-_stoned.ogg
PAGE 1
*************** ADDS NEW QUESTION FORM AND WRITES THE TO QUESTION.TXT
PAGE *********************
<?php
$filename = "question.txt";
$seperator = "/ENDOFLINE/";
if (isset ($_POST['Submit'])){
$new_question = sprintf ("%s$seperator\r\n%s$seperator\r\n",
addslashes($_POST['question']), addslashes($_POST['answer']));
if (!$handle = fopen($filename, "r+")){
echo "cannot open file to edit question";
exit;
}
fwrite ($handle, $new_question);
fclose ($handle);
header ("Location:viewquestion.php");
exit;
}
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>"
method="post">question:<input name="question" type="text"><br>
answer:<input name="answer" type="text"><br>
<input name="Submit" type="submit" value="Submit">
</form>
PAGE 2
********* WILL PLACE ALL OF THE QUESTIONS AND ANSWERS INTO AN ARRAY
******
**** >SPLIT THEM UP INTO A QUESTIONS AND ANSWERS ARRAY IF YOU WISH<
******
<?php
$filename = "question.txt";
$seperator = "/ENDOFLINE/";
if (!$handle = fopen ($filename, "r")){
echo "cannot access question file";
exit;
}
$contents = fread ($handle, filesize ($filename));
fclose ($handle);
$all = explode ($seperator, $contents);
foreach ($all as $question){
echo stripslashes($question).'<br>';
}
?>
"Toby Inkster" <usenet...@tobyinkster.co.uk> wrote in message
news:pan.2004.08.03....@tobyinkster.co.uk...