Location: PHPKode > projects > NetLink > netlink_os/report_s.php
<html>
<head>
<link REL="SHORTCUT ICON" HREF="net.ico">
<link media="screen" type="text/css" rel="stylesheet"  href="main.css" />
<title>
Report a Bug</title>
</head>

<body>
<h3>Report a Bug</h3>
<?php
extract($_POST);
if ($submit)
{
  echo "Submitting Bug.....";
	$date_now = date("l jS of F Y h:i:s A");
	echo "<br/>Bug \"$bugname\"";
	echo "<br/>&nbsp;&nbsp;&nbsp;&nbsp;=&gt; N<small>ET</small>L<small>INK</small> Programmers @ $date_now";
	
	//OPEN DATABASE TO GET USERNAME
	$user=$_SESSION['login'];
	include("db.php");
	
	$user=$_SESSION['login'];
	$user=strtolower($user);
	
	$dbh=mysql_connect ($host,$mysql_user,$pass) or die ('MySQL Error: ' . mysql_error());
	mysql_select_db ($table); 
	
	$sql="SELECT * FROM Accounts WHERE Username='$user';";
	$rs=mysql_query($sql,$dbh);
	
	$row=mysql_fetch_array($rs);
	$f_name=$row['FirstName'];
	$l_name=$row['LastName'];
	$username=$f_name . " " . $l_name;

	mysql_close($dbh);	
	//END DATABASE
	
	
	###################################################################################
	#                   DO NOT CHANGE BELOW THIS LINE                                 #
	###################################################################################
	//Send E-mail
	$to = "$useremail";
	$subj = "New Bugz";
	$mess = "THIS IS MESSAGE IS AUTOMATICALLY GENERATED - DO NOT REPLY\n\n===========================================\n\nThere has been a new bug discovered.\n\nBug Name: $bugname\nBug Description: $bug_desc\n\nFrom: $username\n\nDate Submitted: $date_now";
	$headers = "cc:hide@address.com\r\nbcc:hide@address.com";
	$mailsend = mail($to, $subj, $mess, $headers);
	###################################################################################
	#                   DO NOT CHANGE ABOVE THIS LINE                                 #
	###################################################################################
	
	
	if ($mailsend){
		echo "<br/><b>Bug has been submitted!</b><br/>";
		echo "<br/>Thank you for submitting the Bug \"$bugname\".";
		echo "<script type='text/javascript'>\n";
		echo "setTimeout(\"self.close()\",10000);\n";
		echo "</script>";
	}
	else
		echo "<span id='error'>Error!</span><br/>Sorry, bug was not submitted. Please contact the Webmaster at <a href='mailto:hide@address.com'>hide@address.com</a>";
}
else
{
	echo "<div id='bug'>\n";
	echo "If you encounter a \"bug\" ( <img src='Images/bug_grey_small.png' style='position:relative;top:5px;' alt='A Bug...'/>) within this site, you can report it here! Your report will be filed with our programmers. If your report is serious, then we will post it on the <a href='?id=bugz'>BuGz</a> page. Thank you for your support to make N<small>ET</small>L<small>INK</small> better!\n";
	echo "<br/><br/>\n";
	echo "<form method='post' action='./report_s.php'>\n";
	echo "<table summary='report' border='0'>\n";
	echo "<tr>\n";
	echo "<td>\n";
	echo "Today's Date:\n";
	echo "</td>\n";
	echo "<td>\n";
	$date = date("n / j / Y");
	echo "<input type='hidden' name='date' value='$date'/>";
	echo $date;
	echo "\n";
	echo "</td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo "<td>\n";
	echo "Your E-mail:\n";
	echo "</td>\n";
	echo "<td>\n";
	echo "<input type='text' name='useremail'/>\n";
	echo "</td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo "<td>\n";
	echo "Name for Bug:\n";
	echo "</td>\n";
	echo "<td>\n";
	echo "<input type='text' name='bugname'/>\n";
	echo "</td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo "<td>\n";
	echo "Description of Bug:\n";
	echo "</td>\n";
	echo "<td>\n";
	echo "<textarea cols='20' rows='5' name='bug_desc'>\n";
	echo "</textarea>\n";
	echo "</td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo "<td colspan='2' align='center'>\n";
	echo "<input type='submit' value='Report Bug' name='submit'/>\n";
	echo "</td>\n";
	echo "</tr>\n";
	echo "</table>\n";
	echo "</div>\n";
}
?>
Return current item: NetLink