Location: PHPKode > projects > EasyFest > new/createEventHead.php
	header("Expires: Thu, 17 May 2001 10:17:17 GMT");    // Date in the past
	header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
	header ("Cache-Control: no-cache, must-revalidate");  // HTTP/1.1
	header ("Pragma: no-cache");                          // HTTP/1.0              
		if($_SESSION["loggedIn"] == FALSE){

	$query1=mysql_fetch_array(mysql_query("select UserName FROM users WHERE Type='1' AND  UserName='$UserName'" ));
if($UserName==$query1['UserName'] ){
	// echo $UserName;
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Premium Series by Free CSS Templates</title>
<meta name="keywords" content="" />
<meta name="Premium Series" content="" />
<link href="default.css" rel="stylesheet" type="text/css" media="screen" />

<script language="JavaScript" src="gen_validatorv31.js" type="text/javascript"></script>

<title>Untitled Document</title>
		$EventHead = $_POST['EventHead'];
		$Password = $_POST['Password'];
	/*	$sqlq="SELECT * FROM events WHERE EventAssociate=$UserName";
		$sqlw="SELECT * FROM events WHERE EventAssociate=$UserName AND EventHead=NULL" ;
		$result1 = mysql_query($sqlq);
	     	$numberOfRows1 = MYSQL_NUM_ROWS($result1);
				$result2 = mysql_query($sqlw);
	     	$numberOfRows2 = MYSQL_NUM_ROWS($result2);*/
		$query = "INSERT INTO users(`UserName`, `Password`,`Type`) VALUES ('$EventHead', '$Password','2')";

$result = mysql_query($query) or die("Invalid query: " . mysql_error() . "<br><br>". $query);
				$query1= "UPDATE events SET  EventHead='$EventHead' WHERE EventName='$EventName' ";
$result = mysql_query($query1) or die("Invalid query: " . mysql_error() . "<br><br>". $query1);
$query2 = "INSERT INTO rights(`UserName`, `EventName`) VALUES ('$EventHead', '$EventName')";

$result = mysql_query($query2) or die("Invalid query: " . mysql_error() . "<br><br>". $query2);
	//	}?>

	     <script type="text/javascript">
window.location = "assignRightsToEventHead.php<?php echo "?EventHead="."$EventHead" ;?>"

<div id="wrapper">
	<!-- start page -->
	<div id="page">
    	  <!-- start content -->
        <div id="prtCnt" align="center">
		<div id="content" align="center">
		  <div class="post">
	    <h2 class="title">&nbsp;</h2>
	    <div class="entry">
<table width="573" border="0">
        <td width="80" height="260" class="matter"><?php $query= "SELECT * FROM users ";	$result=@mysql_query($query) or die(" checkPass fatal error: ".mysql_error());
	// Check exactly one row is found:
	//echo $row[1]."<br>";
        <td width="483" >
        <form id="form2"   name="createEventHead" method="post" action="<?php print $_SERVER["PHP_SELF"]; ?>">
   <span class="style1">EventHead Name</span>
           <label for="EventHead"> <input name="EventHead" type="text"  size="45" maxlength="45" /></label>
		  <span class="style1">Password</span>
          <p><label for="Password"> <input name="Password" type="Password"  size="45" maxlength="45" /></label>
            <select name="EventName">
              <?php  $sqlQuery = "SELECT * FROM rights WHERE UserName='$UserName' AND EventAdministration='1'";
		  $result = MYSQL_QUERY($sqlQuery);
$numberOfRows = MYSQL_NUM_ROWS($result);
	$i = 0;
	while ($i<$numberOfRows)
$EventName = MYSQL_RESULT($result,$i,"EventName");?>
              <option value="<?php echo $EventName; ?>"><?php echo $EventName; ?></option>
              <?php $i++;}?>
            <label for="submit"></label>
        <div align="right"></div><p align="right"><input type="submit" name="submit" id="submit" value="Submit" />          

        <!-- end content -->
		<!-- start sidebars -->
		<!-- end sidebars -->
	  <div style="clear: both;">&nbsp;</div>
	<!-- end page -->
<script language="JavaScript" type="text/javascript">
 var frmvalidator = new Validator("createEventHead");
  frmvalidator.addValidation("EventHead","req","Please enter EventHead");
 frmvalidator.addValidation("EventHead","maxlen=45","Max length for EventHead name  is 45");
 frmvalidator.addValidation("Password","req","Please enter Password");
 frmvalidator.addValidation("Password","maxlen=45","Max length for Password is 45");
 frmvalidator.addValidation("EventName","req","You dont have rights ");
 frmvalidator.addValidation("EventName", "maxlen=45","Max length for Password is 45");
Return current item: EasyFest