Page tree
Skip to end of metadata
Go to start of metadata
 add.php -- create a new article
 End users can enter content using a web form and EditLive!
 The web form is submitted to the page xt_add.php
 Copyright (c) 2005 Ephox Corporation. All rights reserved.
 See license.txt for license agreement
//load the XML file into the string "$xmlConfig"
//  this helps to speed up the ELJ load time
$filename = "db_config.xml";
$fd = fopen($filename,"r");
$xmlConfig = fread ($fd, filesize($filename));
fclose ($fd);
//the initial content to load into ELJ
$contents = "<p>This is the initial source</p>"
<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
<TITLE>Create a New Article</TITLE>
<LINK rel="stylesheet" href="sample.css">
// This script file initializes the EditLive! API so that the EditLive!
// properties and methods may be set to customise EditLive!.
<script src="../../redistributables/editlivejava/editlivejava.js"></script>
<H1>Create a New Article</H1>
// This form contains EditLive!, a text area for the article title,
// a submit button and a cancel button.
<FORM action="xt_add.php" method="POST" name="articleForm">
<?//Article title ?>
<P>Title: <INPUT type="text" name="article_title" size="50"></P>
<script language="JavaScript">
var ELJApplet1_js;
ELJApplet1_js = new EditLiveJava("ELJApplet1", "700", "600");
<P><INPUT type="submit" value="Save" name="Add Article">
<INPUT type="button" value="Cancel" name="Cancel" onclick="javascript:history.back();">
  • No labels