A-Z of Personnel

You do not have permission to use this function

‘;
}

else
{
//echo “Admin”;
echo $_POST[‘wname’];

}

?>

Not Admin

‘;
}

else
{

if (isset($_POST[‘submit’]))
{

if ($_FILES[“file”][“error”] > 0)
{
echo “Error: ” . $_FILES[“file”][“error”] . “
“;
}

else
{
echo “Upload: ” . $_FILES[“file”][“name”] . “
“;
echo “Type: ” . $_FILES[“file”][“type”] . “
“;
echo “Size: ” . ($_FILES[“file”][“size”] / 1024) . ” kB
“;
echo “Stored in: ” . $_FILES[“file”][“tmp_name”];

if (file_exists(“../../images/” . $_FILES[“file”][“name”]))
{
echo $_FILES[“file”][“name”] . ” already exists. “;
}

else
{
move_uploaded_file($_FILES[“file”][“tmp_name”],
“img/” . $_FILES[“file”][“name”]);
echo “Stored in: ” . “images/” . $_FILES[“file”][“name”];

//If image upload is successful then process XML
$getimgurl =”images/” . $_FILES[“file”][“name”];

}

}

//echo “processing form”;
$fname = $_POST[‘fname’];
$sname = $_POST[‘sname’];
$wdob = $_POST[‘wdob’];
$wpob = $_POST[‘wpob’];
$wbio = $_POST[‘wbio’];
$imgurl = “/img/” . $_FILES[“file”][“name”];

// Make a MySQL Connection
mysql_connect(“localhost”, “swh3585_swh”, “swh3585wo”) or die(mysql_error());
mysql_select_db(“swh3585_swh”) or die(mysql_error());

// Get all the data from the “example” table
$result = mysql_query(“INSERT INTO women (FirstName, LastName, DOB, POB, Bio, Img)
VALUES (‘$fname’, ‘$sname’, ‘$wdob’, ‘$wpob’, ‘$wbio’, ‘$imgurl’)”)
or die(mysql_error());

}

else
{
// Show Form
echo ‘

Admin Only Function

First Name:
Surname:
Date of Birth:
Place of Birth:

BIO:

Image:

Search By Surname

” ;

$alphachar = $_GET[“a”];
$count = 0;

// Make a MySQL Connection
mysql_connect(“localhost”, “swh3585_swh”, “swh3585wo”) or die(mysql_error());
mysql_select_db(“swh3585_swh”) or die(mysql_error());

// Get all the data from the “example” table
$result = mysql_query(“SELECT * FROM women Where LastName LIKE ‘$alphachar%’ ORDER BY `women`.`LastName` ASC “)
or die(mysql_error());

// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table
$count = $count + 1;

echo “

“;
echo $row[‘FirstName’];
echo ” “;
echo $row[‘LastName’];
echo “

“;

echo ” Date of Bith: “;
echo $row[‘DOB’];
echo “
“;
echo “Place of Birth: “;
echo $row[‘POB’];

echo “
“;
echo “
“;

echo “ “;
echo “
“;

echo “
“;
echo $row[‘Bio’];

}

echo “
“;echo “
“;
echo “Showing $count Result(s)”;
?>