Location: PHPKode > projects > Moderated Web Discussion > chat/cadd.php
<?php

@ $mwd = mysql_pconnect("localhost", "root", "password");

if (!$mwd)
{
  echo "Error: Could not connect to database.  Please try again later.";
  exit;
}
mysql_select_db("mwd");

$gquery = "select firstname, lastname, GID from guest order by lastname, firstname";
$gresults = mysql_query($gquery);
$g_num_results = mysql_num_rows($gresults);


?>
<html>
<head>
<title>Worldwatch Institute - Add Chat Guest</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="/chat/library/css/global.css" type="text/css">
<style type="text/css">
<!--
.swchaptitle {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: CC6600}
.swchapauthor {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: normal}
.swchapteaser {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px}
.swchapresourcetitle {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: normal}
.swchapresources {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px}
.swtitle {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16px; font-weight: bold; color: CC6600}
p {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px}
.swsubheader {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold}
-->
</style>
</head>
<body>
<?php include('library/includes/mainheader.ssi') ?>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td width="162" align="left" valign="top" rowspan="2"> 
      <?php include('/library/includes/chatadminmenu.php'); ?></td>
    <td rowspan="2" valign="top"> 
      <p class="swtitle" align="center">Chat Administration</p>
      <p>Welcome to the Worldwatch Institute Guest Administration Page.</p>        
	  
      <table width="85%" cellpadding="2" cellspacing="0" border="0">
        <tr> 
          <td bgcolor="#996600"><img src="/chat/library/images/spacer.gif" height="4" width="1"></td>
        </tr>
        <tr> 
          <td bgcolor="#FFCC66">Create New Chat</td>
        </tr>
        <tr> 
          <td align="center" valign="top" bgcolor="#CC9999"> 
            <table cellspacing="0" border="0" cellpadding="8" bgcolor="#FFFFFF" width="100%">
                <tr> 
                  <td valign=top width=100% bgcolor="#FFFFFF"> 
				  
      <form name="addchat" method="post" action="index.php">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr> 
                        <td width="13%"><b>Date: </b></td>
                        <td width="87%"><b> 
                          <input type="text" name="date" size="15">
                          </b></td>
                      </tr>
                      <tr> 
                        <td width="13%"></td>
                        <td width="87%"><img src="/chat/library/images/spacer.gif" width="1" height="8"></td>
                      </tr>
                      <tr> 
                        <td width="13%"><b>Time: </b></td>
                        <td width="87%"><b> 
                          <input type="text" name="time" size="15">
                          </b></td>
                      </tr>
                    </table>
                    <br>
                    <table width="100%" border="0" cellspacing="0" cellpadding="4">
                      <tr> 
                        <td nowrap><b>Title:</b></td>
                        <td> 
                          <textarea name="title" cols="50" rows="2"></textarea>
                        </td>
                      </tr>
                      <tr> 
                        <td nowrap>&nbsp;</td>
                        <td>&nbsp;</td>
                      </tr>
                      <tr> 
                        <td nowrap><b>Description:</b></td>
                        <td> 
                          <textarea name="description" cols="50" rows="5"></textarea>
                        </td>
                      </tr>
                      <tr> 
                        <td nowrap>&nbsp;</td>
                        <td>&nbsp;</td>
                      </tr>
                      <tr> 
                        <td nowrap><b>Guest Speaker:</b></td>
                        <td> 
                          <select name="gid" size="1">					   
						  <?php
						      for ($gi=0; $gi < $g_num_results; $gi++)
						   		{
								 $grow = mysql_fetch_array($gresults);
								 echo "<option value=\"";
								 echo $grow["GID"];
								 echo "\">";
								 echo $grow["lastname"];
								 echo ", ";
								 echo $grow["firstname"];
								 echo "</option>";
								}
							?>
                          </select>
                        </td>
                      </tr>
                      <tr> 
                        <td nowrap>&nbsp;</td>
                        <td>&nbsp;</td>
                      </tr>
                    </table>
	    <input type="hidden" name="addchat" value="1">
        <input type="submit" name="Submit" value="Add Chat">
       </form></td></tr>
</table>
	  </td>
     </tr>
</table>
<tr></tr>
  </table>
<br>
</body>
</html>
Return current item: Moderated Web Discussion