liamloveslearning Posted June 4, 2008 Share Posted June 4, 2008 ive spent far too ong on this joke of a messaging system and its starting to bug the hell out of me, so does anyone know why this wont insert?! <form action="" method="post" name="form1" id="form1"> <table cellpadding="2" cellspacing="0"> <tr> <td width="89" valign="top" class="message_rows_subject">To</td> <td class="message_to"><?php echo KT_escapeAttribute($row_reply_msg_id['sender']); ?> </td> </tr> <tr> <td width="89" valign="top" class="message_rows_subject">Subject</td> <td><input type="text" name="subject" id="subject" value="RE: <?php echo KT_escapeAttribute($row_reply_msg_id['subject']); ?>" size="32" /> <?php echo $tNGs->displayFieldHint("subject");?> <?php echo $tNGs->displayFieldError("messages_test", "subject"); ?> </td> </tr> <tr> <td width="89" valign="top" class="message_rows_subject">Message</td> <td valign="top"><textarea name="message" type="text" id="message" value="" cols="20" rows="20"style="width:470px;resize:none;">----------------- Original Message -----------------<?php print "\n";echo $row_reply_msg_id['message']; ?></textarea> <br /> <?php echo $tNGs->displayFieldHint("message");?> <?php echo $tNGs->displayFieldError("messages_test", "message"); ?> </td> </tr> <tr class="KT_buttons"> <td width="89"><div align="left"> <input type="submit" name="KT_Insert1" id="KT_Insert1" value="Send" /> </div></td> <td align="left"> </td> </tr> </table> <input type="hidden" name="datetime" id="datetime" value="<?php echo KT_formatDate($row_rsmessages_test['datetime']); ?>" /> <input type="hidden" name="trash" id="trash" value="<?php echo KT_escapeAttribute($row_rsmessages_test['trash']); ?>" /> <input type="hidden" name="sender_has" id="sender_has" value="<?php echo KT_escapeAttribute($row_rsmessages_test['sender_has']); ?>" /> <input type="hidden" name="reciever_has" id="reciever_has" value="<?php echo KT_escapeAttribute($row_rsmessages_test['reciever_has']); ?>" /> <input type="hidden" name="replied" id="replied" value="<?php echo KT_escapeAttribute($row_reply_msg_id['replied']); ?>" /> </form> is it something to do with the form action? or <input type="submit" name="KT_Insert1" id="KT_Insert1" value="Send" /> ? Quote Link to comment https://forums.phpfreaks.com/topic/108733-message/ Share on other sites More sharing options...
kmark Posted June 4, 2008 Share Posted June 4, 2008 you need to tell the form where to go to process the info. fill in the action attribute in the form tag eg action="formprocess.php" Quote Link to comment https://forums.phpfreaks.com/topic/108733-message/#findComment-557583 Share on other sites More sharing options...
discomatt Posted June 4, 2008 Share Posted June 4, 2008 A blank action will post to itself, according to standards. Doing this, you'd have to make a check to see if the form's been submitted if ( count($_POST) > 0 ) { } # or if ( isset($_POST['subject']) && isset($_POST['message']) && ... ) { } Then insert within the check, making sure to sanitize all POST data Quote Link to comment https://forums.phpfreaks.com/topic/108733-message/#findComment-557599 Share on other sites More sharing options...
runnerjp Posted June 4, 2008 Share Posted June 4, 2008 where does this page post to?? itself or anouther page? Quote Link to comment https://forums.phpfreaks.com/topic/108733-message/#findComment-557648 Share on other sites More sharing options...
liamloveslearning Posted June 4, 2008 Author Share Posted June 4, 2008 its meant to post the data to my table then redirect to my mail centre homepage where a url message is displayed on the page "message sent etc"; i might just wipe my page and start from scratch, ive been using ADDT to produce my insert forms but as this shows its not working correctly Quote Link to comment https://forums.phpfreaks.com/topic/108733-message/#findComment-557651 Share on other sites More sharing options...
Jabop Posted June 4, 2008 Share Posted June 4, 2008 A blank action will post to itself, according to standards. Quote Link to comment https://forums.phpfreaks.com/topic/108733-message/#findComment-557653 Share on other sites More sharing options...
runnerjp Posted June 4, 2008 Share Posted June 4, 2008 humm always better to do it on your own.... do the form on one page then fill action with page2.php and on page 2.php post your infomation into the db there... start easy and work you way up Quote Link to comment https://forums.phpfreaks.com/topic/108733-message/#findComment-557655 Share on other sites More sharing options...
liamloveslearning Posted June 4, 2008 Author Share Posted June 4, 2008 ive sorted it! thanks guys, instead of using ADDT's insert form i followed a tut which worked brilliantly, suppose i best not be bone-idle in future Quote Link to comment https://forums.phpfreaks.com/topic/108733-message/#findComment-557669 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.