conan318 Posted April 14, 2011 Share Posted April 14, 2011 im trying to make a private message system now when i send a message it works fine but when i open the message at the other end i get a blank message. now i think the problem is with $messageid = $_GET['messages'] when i echo $messageid i get nothing, if i use the print_r($_GET) it returns Array ( [messageid] => 12 ). thanks <?php session_start(); $myusername=$_SESSION['myusername']; require "database.php"; $messageid = $_GET['messages']; $message = mysql_query("SELECT * FROM messages WHERE message_id = '$messageid' AND to_user = '$myusername'"); $message=mysql_fetch_assoc($message); echo "$message"; echo "<h1>Title: ".$message['message_title']."</h1><br><br>"; echo "<h3>From: ".$message['from_user']."<br><br></h3>"; echo "<h3>Message: <br>".$message['message_contents']."<br></h3>"; echo '<form name="backfrm" method="post" action="inbox.php">'; echo '<input type="submit" value="Back to Inbox">'; echo '</form>'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/233746-private-message-system-help/ Share on other sites More sharing options...
KevinM1 Posted April 14, 2011 Share Posted April 14, 2011 That means your index is messageid, not messages. In other words, try: $messageid = $_GET['messageid']; Quote Link to comment https://forums.phpfreaks.com/topic/233746-private-message-system-help/#findComment-1201694 Share on other sites More sharing options...
conan318 Posted April 14, 2011 Author Share Posted April 14, 2011 cheers mate silly mistake but it is 4am here in Australia Quote Link to comment https://forums.phpfreaks.com/topic/233746-private-message-system-help/#findComment-1201696 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.