I am passing the variable sessionnum
from the following Javascript function in the page chat.php:
$(document).ready(function(){
timestamp =
It would appear as though you're relying on register_globals, and referencing what would be the POST variable in PHP, instead of referencing the $_POST superglobal index, e.g.
if ( $_POST['action'] == 'postmsg' ) {
$name= mysql_real_escape_string( trim( $_POST['name'] ) );
// query using $name reference
}
As an aside, you should really reconsider allowing the use of the tablename in the client side code.