runnerjp Posted July 3, 2009 Share Posted July 3, 2009 ok at the moments this is how i get a quote form the forum... First i click the quote button which stores the post id <form action="index.php?page=reply&forum=<?php echo $forum; ?>&id=<? echo $forumpostid ?>" method="post"> <input name="quote" type="hidden" value="<? echo $gettopic3['postid']; ?>" /> <input name="submit" type="submit" value="quote" /> </form> then on the reply page i do this <textarea id="inputforum" class="inputforum" name='yourpost' rows='5' cols='40'><?php echo $thePost; if (isset($_POST['quote'])) { $quote = mysql_fetch_assoc(mysql_query("SELECT * from forumtutorial_posts where postid='".$_POST['quote']."'")); ?>[quote=<?php echo $quote['author'] ?> ] <?php echo $quote['post']; ?> [/quote] <?php }?> </textarea> so would you guys say this is the best way to do it or could it be improved?? Link to comment https://forums.phpfreaks.com/topic/164653-getting-quotes-from-forum-needs-improving/ Share on other sites More sharing options...
backie Posted July 3, 2009 Share Posted July 3, 2009 It could be improved by removing a $_POST var from being in escaped into the mysql statement. Also you could think about having which would link back to the post where the quote has been taken from. Link to comment https://forums.phpfreaks.com/topic/164653-getting-quotes-from-forum-needs-improving/#findComment-868314 Share on other sites More sharing options...
runnerjp Posted July 3, 2009 Author Share Posted July 3, 2009 dont get last part lol Link to comment https://forums.phpfreaks.com/topic/164653-getting-quotes-from-forum-needs-improving/#findComment-868317 Share on other sites More sharing options...
backie Posted July 3, 2009 Share Posted July 3, 2009 Yea the did forum code in a forum, wasn't thinking there. [quote=author;postid] Which would link back to the orginal post, or just have it quote=postid and have the backend retrive the author's name each time. Link to comment https://forums.phpfreaks.com/topic/164653-getting-quotes-from-forum-needs-improving/#findComment-868318 Share on other sites More sharing options...
runnerjp Posted July 4, 2009 Author Share Posted July 4, 2009 ok so just add the id into a link Link to comment https://forums.phpfreaks.com/topic/164653-getting-quotes-from-forum-needs-improving/#findComment-868736 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.