Need some help - report page form :/

Hi everyone .
I’m rearly working wiht php/js stuff and now I totally stuck with one problem .
I’m making a report a bug/ problem page ( button) and form .

I don’t know too much but I did something and I need some advices and a lot of help …

This is html code :


<div class="h3">
<h2> Please use this form for right propouse  , do not submit requests for changes via this form. Thank you . </h2>
<form action="report-bug.php" method="post">
<table width="542" border="0" cellpadding="8" cellspacing="8" summary="feedback form" align="left">
<tr><td width="156">Name:</td><td width="330"><input type="text" name="name" size="35" /></td></tr>
<tr><td>Email address:</td><td><input type="text" name="email" size="35" /></td></tr>
  <td><label>Reason</label></td>
      <td>

      <select name="reason" class="select">
        <option value="Game not loading / It's blank">Game not loading / It's blank</option>
        <option value="Social badges won't work">Social badges won't work</option>
		<option value="Wrong description game/wallpapers">Wrong description game/wallpapers</option>
        <option value="other problem">Other problem</option>
      </select>
      </td>
<tr>
<td colspan="2">
Comments<br /><br />
<textarea rows="15" cols="65" name="comments">Give us more information about bug/problem , thank you !</textarea>
</td>
</tr>
<tr>
<td align="left" colspan="2">
<input name="Submit" type="submit" value="Report !" />
<br /><BR>
</td>
</tr>
</table>
</form>
	</div>

and this is from code :


<?
$mailto = 'site@my.com' ;

$subject = "CF Report : BUG/ERROR" ;

$formurl = "report-a-bug.php" ;
$errorurl = "notfound.html" ;
$thankyouurl = "thanks.htm" ;

$uself = 1;

$headersep = (!isset( $uself ) || ($uself == 0)) ? "\\r\
" : "\
" ;
$name = $_POST['name'] ;
$email = $_POST['email'] ;
$comments = $_POST['comments'] ;
$http_referrer = getenv( "HTTP_REFERER" );

if (!isset($_POST['email'])) {
	header( "Location: $formurl" );
	exit ;
}
if (empty($name) || empty($email) || empty($comments)) {
   header( "Location: $errorurl" );
   exit ;
}
if ( ereg( "[\\r\
]", $name ) || ereg( "[\\r\
]", $email ) ) {
	header( "Location: $errorurl" );
	exit ;
}

if (get_magic_quotes_gpc()) {
	$comments = stripslashes( $comments );
}

$messageproper =

	"This message was sent from:\
" .
	"$http_referrer\
" .
	"------------------------------------------------------------\
" .
	"Name of sender: $name\
" .
	"Email of sender: $email\
" .
	"------------------------- COMMENTS -------------------------\
\
" .
	$comments .
	"\
\
------------------------------------------------------------\
" ;

mail($mailto, $subject, $messageproper,
	"From: \\"$name\\" <$email>" . $headersep . "Reply-To: \\"$name\\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.07" );
header( "Location: $thankyouurl" );
exit ;

?>

If you have and better / newer form example , it would be to pass me on.

Thing is :
I need somehow to automatically add a reported link into the from when someone click a report button but I dont know how :frowning:

Any ideas ??? And also I need a chek of whole code if something missing … Thanks.

if you will search and know, little more on mysql data reading , it will help more to you.
few lines as below beforehand.

<?php
while($row=mysql_fetch_assoc($result)){

if($row['langfilename']==$filenamefromreaddir){
	// put them in array
	$files[] = $row['langfilename'];
}

}
?>