<?php
	if($_GET['data']) {
		// Write Data to irc_wait.txt
		if (strtolower(substr($_GET['data'],0,6)) == '/quit ') {
			$f = fopen("irc_wait.txt","r+");
			fwrite($f,"QUIT  ".substr($_GET['data'],6)."\r\n");
			fclose($f);
		} elseif ($_GET['data'] == '/quit') {
			$f = fopen("irc_wait.txt","r+");
			fwrite($f,"QUIT  \r\n");
			fclose($f);
		} elseif (strtolower(substr($_GET['data'],0,4)) == '/me ') {
			$f = fopen("irc_wait.txt","r+");
			fwrite($f,"ME ".substr($_GET['data'],4)."\r\n");
			fclose($f);
		} elseif (strtolower(substr($_GET['data'],0,5)) == '/msg ') {
			$f = fopen("irc_wait.txt","r+");
			fwrite($f,"PRIV ".substr($_GET['data'],5)."\r\n");
			fclose($f);
		} elseif (strtolower(substr($_GET['data'],0,1)) == '/') {
			$f = fopen("irc_wait.txt","r+");
			fwrite($f,"RAW ".substr($_GET['data'],1)."\r\n");
			fclose($f);
		} else {
			$f = fopen("irc_wait.txt","r+");
			fwrite($f,"MSG ".$_GET['data']."\r\n");
			fclose($f);
		}
	} 
?>
<form method="get" action="irc_input.php">
<div style="width:100%;">
 <input type="text" name="data" style="width:89%;"><input type="submit" value="Send" style="width:10%;" />
</div>
</form>