PHP Classes

File: list_edit.html

Recommend this page to a friend!
  Classes of nanou morgan  >  noticeboard  >  list_edit.html  >  Download  
File: list_edit.html
Role: ???
Content type: text/plain
Description: Admin folder..To edit the category list
Class: noticeboard
Author: By
Last change:
Date: 19 years ago
Size: 2,641 bytes



Class file image Download

include  ('');
include  ('');

* Nanou Morgan                  Web            
* NoticeBoard version 1.1		Personal Web
* January 2001					Email:


$mylist = file ($cat_file);
$title= "Modify The Category list";

if ($submit == ""){

		<INPUT TYPE='hidden' NAME='list' VALUE='$list'>
		<P ALIGN='CENTER'><FONT FACE='Arial' color='blue'>
		<B>This is the current Category list.<br>
		Type in a new item or modify the text <br>
		in the box and press the \"Update List\" button</B></FONT><br><br>
		<FONT FACE='Arial' color='red'>WARNING: Do not leave extra spaces after each line<br>
		Also use and instead of the symbol &amp;
		<TR> <TD><TEXTAREA NAME='newlist' ROWS='20' COLS='60' nowrap>";		

for ($L=0; $L< count ($mylist);$L++){
	$content.= "$mylist[$L]";

		<TR>	<TD>	<CENTER>	<P>
		<INPUT TYPE='button' VALUE='CANCEL' onClick='history.go(-1)'> Or <INPUT TYPE='submit' NAME='submit' VALUE='Update List'>
		</CENTER>	</TD>	</TR>	</TABLE></FORM>

else if ($submit == "Update List"){

$myfile = fopen ($cat_file,"w");
if  (!($myfile)){
print ("Error:\n");
print ("File '$myfile' could not be opened\n");

$newlist= ereg_replace( "\r\r", "\r", $newlist);

fputs($myfile, "$newlist");

fclose ($myfile);

$content.="<center><H3> <FONT FACE='Arial' COLOR='#999999'>The file <b>$list</b> has been updated</font></h3><br><br>
<P><A HREF='index.html'>Administration Entry</a> Or <A HREF='../index.html'>Notice Board</a></FONT></P></center>";

$t = new Template( $path);
                                  // create a template object named $t 

$t->set_file( "MyFileHandle", "$template");
                                  // set MyFileHandle = our template file 
$t->set_var(array( "TITLE" => $title,
					"FOOTER" => $bot,
				   "CONTENT" =>  $content));

                                  // set template variable 
$t->parse( "MyOutput", "MyFileHandle"); 
                                  // set template variable MyOutput = parsed file 
$t->p( "MyOutput");  // output the value of MyOutput (our parsed data)