therocker Posted September 24, 2013 Share Posted September 24, 2013 Hello so I'm trying to make my own simple forum. How would can I do a quick quote/ reply to comment. Something WordPress would normally do with the #respond. I've done my own code and I can't seem to insert the code into a hidden input so that the users can't see the HTML codes that are outputted in the reply string. Generally, my code works fine and all, it's just that when someone clicks the "Quote" link, it literally inserts the actual HTML outputs into the textarea. I want something like WordPress' #respond command so that when someone hits the "Quote" link, it'll still quote the actual content the user is trying to respond to, but it'll also not output the HTML codes into the textarea. Here is my PHP code: <?php $reply = '<div style=\"border: 1px dashed\"><span style=\"text-transform: uppercase; font-family: Oswald, Arial, Helvetica, sans-serif; font-size: 16px; font-weight: 300; margin: 0px 10px 0px 0px; width: 100%; color: #00A6EB;\">' . $row['username'] . '</span><p>' . $row['message'] . '</p></div><br /><br />'; ?> Here is my HTML code: <a href="#" onclick='insertext("<? echo $reply; ?>"); return false;'>Quote</a> Here is my Javascript code: <script type="text/javascript"> function insertext(text) { document.formname.messages.value += text + " "; document.formname.messages.focus(); } </script> Quote Link to comment https://forums.phpfreaks.com/topic/282401-trying-to-create-a-php-quotereply-command/ Share on other sites More sharing options...
therocker Posted September 25, 2013 Author Share Posted September 25, 2013 bump Quote Link to comment https://forums.phpfreaks.com/topic/282401-trying-to-create-a-php-quotereply-command/#findComment-1451179 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.