views:

15

answers:

1

HI I'm building a php based website and wanted to know if there any way to allow my client to upload their content from a word document (or any word file)?

The upload should replace (or add) content to a page, allowing her to update her content. I know this is some sort of cms, but I don't know where to begin.

I currently have an article.php page that uses this code:

<?php

$thisPage="Writing";

include("header.php");


$page = $_GET['article'];
$file = "articles/".$page.".html";
if(file_exists($file)) {
  include($file);
} else {
  print "404 Error. Page does not exist";
}

function IsSafeInclude($x) {
    if(strpos($x, "/../") !== false || strpos($x, "../") === 0 || strpos($x, "/..") == (strlen($x) - 3) || $x == '..')
        return false;
    else
        return true;
}

include("html/articles-left.html");

include("footer.php");

?>

The $page function allows me to link different html files that would load when clicked. What I want to do is allow the client to upload/update her different articles to the site. Make it easy to use.

Here is the link to the site: here

Thanks alot!

gdinari

+2  A: 

What you're asking is non-trivial and, by the question you make you probably should start with something easier, like a textarea and teach the client how to Copy/Paste text from other documents.

  1. start with html simple textarea
  2. try using TinyMCE to have an improvement while keeping graceful degradation
  3. add a file uploader and read that .DOC file and pass it to the text-area
Frankie