PhpSnip.com

User Stats

Write Generation I

Write is a simple editor for the web. It has a File list box on the left side and the editor textfield in the right side. The next step is to build a class module which generates automatically this editor.

Info

 Download  View Source (print view)
 Rating : 4.7  Views : 459

Source Code ( 38 lines )

<HTML>
<BODY>
<TABLE border="0" cellspacing="0" cellpadding="0">
<TR>
	<TD valign="top">
	<FORM method="post" action="write.php?action=open">
		<select name="lstFilename" size="5">
		<?
			$vDir = dir("data/");
			while($entry=$vDir->read()) {
				if ( ($entry != ".") && ($entry != "..") ) echo ("<option value="$entry">".$entry);
			}
			$vDir->close();
	      	?>
		</select><br>
		<input type="submit" value="Open...">
	</FORM>
	</TD>
	<TD valign="top">

	<textarea name="lstText" rows="25" cols="80"><?

		if ($action == "open") {
			if ( $lstFilename && !empty($lstFilename) ) 
			{	
				$v=File("data/".$lstFilename);
				for ($i=0;$i<count($v);$i++) {
					echo($v[$i]."n");
				}
			}
		}	
	?></textarea>
	</TD>
</TR>
</TABLE>
		
</BODY>
</HTML>

Search

Subscribe

  Rss Feeds

Sponsors

Advertise