um sistema de mensagens como os dos forums, com caixa de emails, caixa de saida e entrada, e quando conectar no painel de controle já mostrar se você recebeu alguma msgn nova.... comecei a fazer mas preciso do auxilios de voces que sabem bastante de php, fiz uma tabela pra inserir os valores usuario(mesmo que o login do painel de controle): varchar 100 primarykey cont(variavel pra checar as msgs): int 4 remetente(quem enviou a msg): varchar 100 assunto(assunto da msg): varchar 100 msg(mensagen): varchar 500 data(data do envio da msg): varchar 100 cont(add +1 por msg,se >= 20 caixa de msg cheia):int4 vip(1=sim, 0=não):int4 admin(1=sim, 0=não):int 4 meu formulario user_email.php <?php
include("config.php");
@session_start();
if (!(isset($_SESSION['login'])))
{
header("Location: index.php");
}
$login= $_SESSION["login"];
$buscanome = "SELECT nome FROM MEMBRO WHERE nick='$login'";
$resultado = mssql_query( $buscanome );
$nome = mssql_fetch_row($resultado);
?>
<body bgcolor="#000000">
<table width="380" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><font color="#FFFFFF"><div align="center">
<fieldset>
<font color="#FFFFFF">
<legend>E-mail - Player</legend>
</font><table width="379" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="379"><div align="center">
<form action="domail.php" method="post" name="new_request" id="new_request">
<table width="323" border="0" align="center" cellpadding="0" cellspacing="4">
<tr>
<td class="normal_text_white"><div align="left"><strong><font color="#FFFFFF">De</font></strong></div></td>
<td><div align="left"><strong><font color="#FFFFFF"> <? echo"<font color=#999999>$nome[0]</font>";?>
</font></strong></div></td>
</tr>
<tr>
<td width="46" height="44" class="normal_text_white"> <div align="left"><strong><font color="#FFFFFF">Para:</font></strong></div></td>
<td width="265" align="left" class="normal_text_white"><strong><font color="#FFFFFF">
<strong><font color="#FFFFFF">
<select name="player" id="player">
<?php
$sql=mssql_query("SELECT usuario FROM EMAIL order by usuario ");
while($res=mssql_fetch_array($sql))
{ print ('<option align=left colspan=2>'.$res['usuario'].'</option>');}
?>
</select>
</font></strong> </font></strong></td>
</tr>
<tr>
<td width="46" height="25" class="normal_text_white"> <div align="left"><strong><font color="#FFFFFF">Assunto</font></strong></div></td>
<td><div align="left"> <strong><font color="#FFFFFF">
<input name="assunto" type="text" id="assunto" size="30" maxlength="30">
</font></strong><font color="#FFFFFF"> <font color="#666666" size="2">(30
caracteres)<em> </em></font></font></div></td>
</tr>
<script language=javascript>
function CheckLeng(Target)
{
MaxLength = 300;
if (Target.value.length > MaxLength)
document.new_request.msg.value =
document.new_request.msg.value.substr(0,MaxLength);
}
</script>
<tr>
<td class="normal_text_white"><div align="left"><strong><font color="#FFFFFF">Mensagem</font></strong></div></td>
<td rowspan="2"><div align="left"> <strong><font color="#FFFFFF">
<textarea name="msg" cols="40" rows="10" id="msg" ></textarea>
</font></strong></div></td>
</tr>
<tr>
<td><strong><font color="#FFFFFF">
<input name="new_request" type="hidden" id="new_request" value="new_request">
</font></strong></td>
</tr>
</table>
<table width="200" border="0" align="center" cellpadding="0" cellspacing="4">
<tr>
<td width="104"> <div align="center"><strong><font color="#FFFFFF">
<input type="submit" name="Submit" value="Enviar" class="button">
</font></strong></div></td>
<td width="84"> <div align="center"><strong><font color="#FFFFFF">
<input type="reset" name="Reset" value="Limpar" class="button">
</font></strong></div></td>
</tr>
</table>
</form>
</div></td>
</tr>
</table>
</fieldset></td>
</tr>
</table>
<table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table>
<font color="#FFFFFF">
<script type="text/javascript">
tabPane1.addTabPage( document.getElementById( "tab_pane-3" ) );
</script>
</font>
domail.php
</head>
<body background="../Register/imagens/fundo2.jpg" leftmargin="0" topmargin="0" onselectstart="return false" oncontextmenu="return false">
<html>
<head>
<title>-=Urg Games Counter-Strike 1.6- 24HoRaS</title>
<style>
<!--
.texto{
font-family:Verdana;
font-size:10px;
color:#333333;
}
-->
</style>
<?php require 'config.php'; ?>
<?php require 'sql_inject.php'; ?>
<body onselectstart="return false" oncontextmenu="return false" topmargin="0" leftmargin="0" text="#333333">
<br>
<th scope="col">
<p class="texto">
<?php
//verifica se o login foi feito
@session_start();
if (!(isset($_SESSION['login'])))
{
header("Location: index.php");
}
$remetente= $_SESSION["login"];
$assunto=$_POST['assunto'];
$destino=$_POST['player'];
$msg=$_POST['msg'];
//guarda a data atual
$d= date("d/m/Y");//dia/mes/ano
$t = date('g:i A');//hora:minutos
$data = "$d $t";
//verifica se os campos forum preenchidos corretamente
if (empty($remetente) || empty($assunto) || empty($destino) || empty($msg))
{
echo "Alguns campos foram deixados em branco.Por favor preencha corretamente e tente novamente.";
}
else
{
//verifica se acaixa de mensagens esta cheia
$contador = "SELECT cont FROM EMAIL WHERE usuario = '$destino'";
if ($contador >= 10) {
echo'Desculpe, Caixa de mensagens Cheia!';}
else { o
$cont = ($contador + 1);
//inserindo dados no bd mssql
include 'config.php';
$msquery = "INSERT INTO EMAIL (assunto,msg,remetente,data,cont) VALUES ('$assunto','$msg','$remetente','$data','$cont') WHERE usuario='$destino'";
echo("Mensagem Enviada com Sucesso!</br>");
echo("Assunto: $assunto</br>");
echo("Destinatario:$destino </br>");
echo("contador:$cont </br>");
}
}
?> esse codigo eu fiz mas não ta inserindo nad ano bd, mas pelo q revisei ta td ok...agradeço desde já a ajuda dos que intenden e q podem dar uma mão VLW!!!!