I'm trying to develop an online messaging system from scratch to be placed on a multiuser site. So the users can send messages between eachother.
Basically the user logs in and a var, $employee, is set with thier name. They then goto the employee page, the main page.
From thier, the following script is posted for them to send messages:
print '<p align="center"><small><font face="Arial">Send Message</font></small></p>';
print '<form method="POST" action="http://tio.moonwalker.org/scripts/submsg.php?employee='.$employee.''">';
print ' <div align="center"><center><table border="0" cellpadding="0" cellspacing="0" width="65%">';
print ' <tr>';
print ' <td width="50%" valign="top"><small><font face="Arial">To:</font></small></td>';
print ' <td width="50%" valign="top"><input type="text" name="toprsn" size="20"></td>';
print ' </tr>';
print ' <tr>';
print ' <td width="50%" valign="top"><small><font face="Arial">From:</font></small></td>';
print ' <td width="50%" valign="top"><input type="text" name="fromprsn" size="20"></td>';
print ' </tr>';
print ' <tr>';
print ' <td width="50%" valign="top"><small><font face="Arial">Message: (Max 255 Characters)</font></small></td>';
print ' <td width="50%" valign="top"><textarea rows="4" name="msg" cols="27"></textarea></td>';
print ' </tr>';
print ' </table>';
print ' </center></div><div align="center"><center><p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>';
print ' </center></div>';
print '</form>';
As you can tell the form goes to submsg.php?employee='.$employee.' < that way it brings the employee with it
submsg.php looks like this:
<?
include('cnt.php');
$date = date("M d, Y");
$result = mysql_query("INSERT into messages VALUES ('$id','$toprsn','$fromprsn','$date','$msg')");
?>
Message sent.
<?
print '<font face="Arial"><small><center><a href="../employee.php?employee='.$employee.'">Back</a></small></center></font>';
?>
Yet the script only INSERT's the ID and Date and leaves the rest out as blank fields. cnt.php is the script that has the db connection and table select parameters.
anyone have any idea why its not inserting the rest of the stuff from the form? and how i can fix it?
any help would be appreciated 🙂
thx, zimm