<?php

include 'db.php';
include 'error.php';
include 'auth.php';

include 'header.php';


$emailId=clean($_GET["emailId"],3);
$status=clean($_GET["status"],1);


switch($status)
{
	case "T":
		$query="SELECT * FROM email WHERE email_id=$emailId";

		if(!($connection=@mysql_connect($hostName, $dbUsername, $dbPassword)))
			die("Could not connect");

		if(!(mysql_select_db ($databaseName, $connection)))
			showerror();

		if(!($result=@mysql_query($query,$connection)))
			showerror();

		mysql_close($connection);

		if($row=@mysql_fetch_array($result))
		{
			echo"The Email Address for ".$row["email_name"]." was modified to:<br>";				
			echo $row["email_value"];

		}
		break;
		
	case "F":
		echo"Error adding/modifying Email Address, please retry";
		break;

	default:
		echo"Unexpected arrival";
}

include 'footer.php';
?>


