Re: Contact Staff Form [FREE]
This is what it should be this works tested on my game.
as Jesse60905 did not convert it propaly i think :roll:
<?php
include "globals.php";
if($_POST['go'])
{
$to = (int) $_POST['staff'];
$_POST['text'] = strip_tags($_POST['text']);
$msg = str_replace(array("\n"),array("
"),htmlentities($_POST['text']));
$db->query("INSERT INTO mail VALUES ('',0,$userid,$to,unix_timestamp(),'Staff contact form','$msg')") or die($db->error());
print "Your mail to the selected staff member has been sent.
Please allow 24 hours for a response to be returned.
Thank You.
";
}
else
{
$q=$db->query("SELECT * FROM users WHERE user_level > 1 ORDER BY user_level");
print "[b]Contact Staff[/b]
<form action='cstaff.php' method='post'>
Staff Member: <select name='staff'>";
while($z=$db->fetch_row($q))
{
print "<option value='{$z['userid']}'>{$z['username']}</option>";
}
print "</select>
Message to staff member:
<textarea name='text' rows='7' cols='40'>Send a mail to the selected staff member</textarea>
<input type='hidden' name='go' value='true'>
<input type='submit' value='Send' />
</form>";
}
$h->endpage();
?>