Location: PHPKode > projects > NetLink > netlink_os/report.php
<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                                 #
	###################################################################################
	
	
	
	echo "<br/><b>Bug has been submitted!</b><br/>";
	echo "<br/>Thank you, $username, for submitting the Bug \"$bugname\".";
	echo "<hr/>";
}
?>
<div id='bug'>
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!
<br/><br/>
<form method='post' action='?id=report'>
<table summary='report' border='0'>
<tr>
<td>
Today's Date:
</td>
<td>
<?php
$date = date("n / j / Y");
echo "<input type='hidden' name='date' value='$date'/>";
echo $date;
?>
</td>
</tr>
<tr>
<td>
Your E-mail:
</td>
<td>
<input type='text' name='useremail'/>
</td>
</tr>
<tr>
<td>
Name for Bug:
</td>
<td>
<input type='text' name='bugname'/>
</td>
</tr>
<tr>
<td>
Description of Bug:
</td>
<td>
<textarea cols='20' rows='5' name='bug_desc'>
</textarea>
</td>
</tr>
<tr>
<td colspan='2' align='center'>
<input type='submit' value='Report Bug' name='submit'/>
</td>
</tr>
</table>
</div>
Return current item: NetLink