Location: PHPKode > projects > pmchat > pmchat/createchatroom.php
<html>
<head>
<LINK href="style.css" rel="stylesheet" type="text/css">
<script src="util.js"></script>
<script src="addkiller.js"></script>
<script src="sarissa.js"></script>
<link rel="stylesheet" type="text/css" href="niftyCorners.css">
<link rel="stylesheet" type="text/css" href="niftyPrint.css" media="print">
<script src="nifty.js"></script>

<script language="javascript">

function setMessage(msg)
{

	if(document.getElementById("responseMessage"))
	{
		document.getElementById("responseMessage").innerHTML=msg;
		document.getElementById("responseTD").className="";
	}
}


function SetCookie(cookieName,cookieValue,nDays) {
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue)
                 + ";expires="+expire.toGMTString();
}
<?
include('db.inc');
?>
function submitform()
{
if(document.enterform)
{
	var f=document.enterform;

	if(f.roomname.value==""){
		alert('Enter a Name for the Chat Room');
		return;
		}
	
	var xmlhttp = new XMLHttpRequest();
	xmlhttp.open("POST", "./createcr.php", true);
	xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");
	var params="roomname="+f.roomname.value;
	params+="&comment="+f.comment.value;
	xmlhttp.onreadystatechange = function() {
                if (xmlhttp.readyState == 4) {
			var msg=xmlhttp.responseText;
			//alert(msg);
			try{
			var i1=msg.indexOf("<ROOMID>");			
			var msg1=msg.substr(i1+8);
			var i2=msg1.indexOf("</ROOMID>");
			var msg2=msg1.substr(0,i2);		
			var lk="./login.php?chatroom="+msg2;
			setMessage("<b>Created Chat Room :</b><a href='"+lk+"'><b>"+lk+"</b></a>");	
			}
			catch(ex){
				alert('Unable to create chatRoom');
				}
                }
        }
        xmlhttp.send(encodeURI(params));	
	
}

}

</script>
</head>
<body>

 
<!--form name="enterform" action="" onsubmit="submitform();return false;" method="post">

Chat Room Name : <input type="text" name="roomname" value="">
<br>
Comments : <input type="text" name="comment" value="">

<input type="submit" name="Submit" value="Submit">
</form-->


<center>
		<div  id="responseTD" class="hide" style="width:70%">
    	<div style="display:inline;height:10px;width:100%" id="rmsg" class="bgorange">
    	<table height="10" width="100%" class="bgorange">
    	<tr>
    	<td id="responseMessage" align="center" class="normaltextbold">

    	</td>
    	</tr>
    	</table>
    	</div>
    	</div>
    	</center>


<br>

<form name="enterform" action="" onsubmit="submitform();return false;" method="post">
	<center>
	<div id="registerUI" style="width:60%">

	<table width="100%" cellpadding="5" cellspacing="0" class="textblue" bgcolor="#CFDFFF" align="center">

	<tr><td colspan="3" height=3><img src='../images/spacer.gif' height='3' width='1'></td></tr>
	<tr><td colspan="3" height="19" bgcolor="#666699"><font color="white" face="Arial" size="2">Create Chat Room </font></td></tr>
	<tr><td colspan="3" height=3><img src='../images/spacer.gif' height='3' width='1'></td></tr>

	<tr>

	<td>Chat Room Name</td><td>:</td>
	<td>
	<input type="text"   name="roomname" size="30" value="">
	&nbsp;&nbsp;
	</td>
	</tr>

	<td>Comments</td><td>:</td>
	<td>
	<input type="text"   name="comment" size="30" value="<?echo $email;?>">
	</td>
	</tr>

	<tr>
	<td colspan="3" align="right">
	<input type="submit" name="submit" value="Sign Up" style="border: 2px solid;background-color:#efefef;font:bold  12px Verdana">
	</td>
	</tr>



	</table>

	</div>

	<center>
	</form>


	<br><br><br>


	<table width=100% >
	<tr><td align="left">
	<p style='height:25px;font-family: georgia; font-size: 28px;width:60%;display:block;'>
	<i>Create your Own Chat Room</i>
	</p>
	<span style='height:25px;font-family: georgia; font-size: 18px;width:60%'>

	PM Chat is a free chat service which makes group chat more fun and useful. Create your own chat rooms for chatting with your friends. You can even share instant private messages to any group of your friends who are in the chat room.


	</span>
	<br><br>
	<span style='height:25px;font-family: georgia; font-size: 28px;width:60%;display:block;'>
	<i>How it's done?</i>
	</span>
	<span style='height:25px;font-family: georgia; font-size: 18px;'>
	<ol>
	<li>Create a chat room</li>
	<li>Invite others by sending the link of created chat room</li>
	<li>Chat with any no of friends online</li>
	</ol>
	</span>	

	</td></tr></table>
	
	

			<script language="javascript">
			if(NiftyCheck())
			{
			Rounded("div#registerUI","white","#CFDFFF");
			Rounded("div#rmsg","white","#FFD262");
			}
		</script>


</body>
</html>

Return current item: pmchat