runnerjp Posted October 19, 2008 Share Posted October 19, 2008 like on here where you click the quote link so that you can quote someone the quote like so... this is what im trying to achive... now to coolect the quote iv done this <?php function quoteThis() { var txt = ''; if (window.getSelection) { txt = window.getSelection(); } else if (document.getSelection) { txt = document.getSelection(); } else if (document.selection) { txt = document.selection.createRange().text; } else txt = ""; var hiddenForm = getElementById("hiddenQuoteSendoff"); hiddenForm.quote_text = txt; hiddenForm.submit(); }?> but i get unexpected_t VAR here var txt = ''; Quote Link to comment https://forums.phpfreaks.com/topic/129077-solved-grabbing-a-quote/ Share on other sites More sharing options...
Zane Posted October 19, 2008 Share Posted October 19, 2008 that is because that code isn't PHP it is javascript Quote Link to comment https://forums.phpfreaks.com/topic/129077-solved-grabbing-a-quote/#findComment-669146 Share on other sites More sharing options...
wildteen88 Posted October 19, 2008 Share Posted October 19, 2008 That is no where near the PHP syntax. More like Javascript. You cannot call PHP code based on a user event. This can only be archived by a Client Side Languages such as javascript. Quote Link to comment https://forums.phpfreaks.com/topic/129077-solved-grabbing-a-quote/#findComment-669147 Share on other sites More sharing options...
runnerjp Posted October 19, 2008 Author Share Posted October 19, 2008 lol thnaks for some reason i added php tags to it came back to it now after 2 weeks and could not figure it out lol Quote Link to comment https://forums.phpfreaks.com/topic/129077-solved-grabbing-a-quote/#findComment-669151 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.