liamloveslearning Posted May 25, 2008 Share Posted May 25, 2008 hi, im having trouble trying to create a echo data from "view message page" to "reply to message page" i assume its something to do with my form id but ive tried loads of variations to no avail, could it be down to my recordsets? heres my code if anyone can help, this is my "view msg page" <?php session_start(); $user = $_SESSION['kt_login_id']; //Are they logged in or not? if(!$user) { echo "<br><p>Blah blah you arent logged in and stuff, you should do that or something</p><br>"; } else { //We need to grab the msg_id variable from the URL. $msg_id = $_REQUEST['msg_id']; //Get all of the information about the message with and id number of the one sent through the URL $view_msg = mysql_query("SELECT * FROM messages_test WHERE id = '$msg_id'"); $msg = mysql_fetch_array($view_msg); $reciever = $msg['reciever']; $sender = $msg['sender']; $subject = $msg['subject']; $message = $msg['message']; $datetime = $msg['datetime']; //If the person who is supposed to recieve the message is the currently logged in user everything is good if($reciever == $user) { //The message was recieved, so lets update the message in the database so it wont show up in the sent page any more mysql_query("UPDATE messages_test SET recieved='1' WHERE id = '$msg_id'"); //Lets get the private message count, to display for the user $sql = mysql_query ("SELECT pm_count FROM members WHERE member_id='$user'"); $row = mysql_fetch_array ($sql); $pm_count = $row['pm_count']; //Calculate the percentage full $percent = $pm_count/'50'; $percent = $percent * '100'; //Now we will display the little navigation thing, the fullness of the inbox, then display message information stuff, like who its from, the subject, and the body ?> <center> <b> <table width="100%"> <tr> <td width="94" valign="middle" class="message_header">From</td> <td colspan="3" valign="middle" class="message_rows"><a href = "<?php echo "../member_profile.php?member_id=$sender"; ?>" class="message_rows_subject"><?php echo $sender; ?></a></td> </tr> <tr> <td width="94" valign="middle" class="message_header">Date</td> <td colspan="3" valign="middle" class="message_rows_subject"><?php echo $datetime; ?></td> </tr> <tr> <td width="94" valign="middle" class="message_header">Subject</td> <td colspan="3" valign="middle" class="message_rows_subject"><?php echo $subject; ?></td> </tr> <tr> <td width="94" valign="top" class="message_header">Body</td> <td height="300" colspan="3" valign="top" class="message_rows"><?php echo $message; ?></td> </tr> <tr> <td width="75" valign="top"><form id="form1" name="form1" method="post" action="mail_reply.php"> <label> <input type="submit" name="reply_msg" id="reply_msg" value="Reply" /> </label> <input name="to" type="hidden" id="to" value="<?php echo $row_reply_msg['id']; ?>" /> </form> </td> <td width="75" valign="top"><form id="form2" name="form2" method="post" action=""> <label> <input type="submit" name="Save" id="Save" value="Save" /> </label> </form> </td> <td width="75" valign="top"><form id="form3" name="form3" method="post" action=""> <label> <input type="submit" name="Delete" id="Delete" value="Delete" /> </label> </form> </td> <td width="300" valign="top"> </td> </tr> </table> </center> <?php } //Everything is not good, someone tried to look at somone else's private message else { ?> <p>You cannot view somebody else's messages!</p> <?php } } ?> and my reply page <form method="post" id="form1" action="<?php echo KT_escapeAttribute(KT_getFullUri()); ?>"> <table cellpadding="2" cellspacing="0" class="KT_tngtable"> <tr> <td class="KT_th"><label for="sender">To</label></td> <td><input type="text" name="sender" id="sender" value="<?php echo KT_escapeAttribute($row_rsmessages_test['sender']); ?>" size="32" /> <?php echo $tNGs->displayFieldHint("sender");?> <?php echo $tNGs->displayFieldError("messages_test", "sender"); ?> </td> </tr> <tr> <td class="KT_th"><label for="subject">Subject</label></td> <td><input type="text" name="subject" id="subject" value="<?php echo KT_escapeAttribute($row_rsmessages_test['subject']); ?>" size="32" /> <?php echo $tNGs->displayFieldHint("subject");?> <?php echo $tNGs->displayFieldError("messages_test", "subject"); ?> </td> </tr> <tr> <td class="KT_th"><label for="message">Message</label></td> <td><input type="text" name="message" id="message" value="<?php echo KT_escapeAttribute($row_rsmessages_test['message']); ?>" size="32" /> <?php echo $tNGs->displayFieldHint("message");?> <?php echo $tNGs->displayFieldError("messages_test", "message"); ?> </td> </tr> <tr class="KT_buttons"> <td colspan="2"><input type="submit" name="KT_Update1" id="KT_Update1" value="Update record" /> </td> </tr> </table> <input type="hidden" name="id" id="id" value="<?php echo KT_escapeAttribute($row_rsmessages_test['id']); ?>" /> <input type="hidden" name="reciever" id="reciever" value="<?php echo KT_escapeAttribute($row_rsmessages_test['reciever']); ?>" /> <input type="hidden" name="datetime" id="datetime" value="<?php echo KT_formatDate($row_rsmessages_test['datetime']); ?>" /> </form> Link to comment https://forums.phpfreaks.com/topic/107167-reply-to-message/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.