skateme Posted April 19, 2008 Share Posted April 19, 2008 Hi! I'm trying to replace text in a textarea on a web site, a forum for example, and then submit the form. How do I do this with PHP? I tried searching online but cannot find anything. Thanks in advance Link to comment https://forums.phpfreaks.com/topic/101858-how-to-replace-text-in-a-texarea/ Share on other sites More sharing options...
marcus Posted April 19, 2008 Share Posted April 19, 2008 <textarea><?php echo str_replace("i hate dogs", "i love all kinds of dogs", $text); ?></textarea> not sure what you mean exactly, is the text you're trying to replace in a database? Link to comment https://forums.phpfreaks.com/topic/101858-how-to-replace-text-in-a-texarea/#findComment-521288 Share on other sites More sharing options...
skateme Posted April 19, 2008 Author Share Posted April 19, 2008 No. It's a standard page and I'm trying to submit a form with text in the textarea Link to comment https://forums.phpfreaks.com/topic/101858-how-to-replace-text-in-a-texarea/#findComment-521297 Share on other sites More sharing options...
Fadion Posted April 19, 2008 Share Posted April 19, 2008 U can get the post data and then use str_replace() or regex to replace the text. Whats the need of replacing before submitting? Describe what u really want to achieve so anyone can understand this better. Link to comment https://forums.phpfreaks.com/topic/101858-how-to-replace-text-in-a-texarea/#findComment-521298 Share on other sites More sharing options...
thebadbad Posted April 19, 2008 Share Posted April 19, 2008 EDIT: Sorry, wrong topic AND gibberish. Link to comment https://forums.phpfreaks.com/topic/101858-how-to-replace-text-in-a-texarea/#findComment-521310 Share on other sites More sharing options...
skateme Posted April 19, 2008 Author Share Posted April 19, 2008 U can get the post data and then use str_replace() or regex to replace the text. Whats the need of replacing before submitting? Describe what u really want to achieve so anyone can understand this better. I want to create a script that submits information on a web site (thats not mine). I want to put some text in the textarea field and then submit the form. This is somewhat related to programs that automatically post a preset comment on MySpace pages. I want to do exactly what those programs do but not on MySpace. Does this clarify it a little bit? Link to comment https://forums.phpfreaks.com/topic/101858-how-to-replace-text-in-a-texarea/#findComment-521315 Share on other sites More sharing options...
chigley Posted April 19, 2008 Share Posted April 19, 2008 cURL and/or file_get_contents() depending on whether the form uses POST or GET. Link to comment https://forums.phpfreaks.com/topic/101858-how-to-replace-text-in-a-texarea/#findComment-521317 Share on other sites More sharing options...
skateme Posted April 19, 2008 Author Share Posted April 19, 2008 How would I implement that? Link to comment https://forums.phpfreaks.com/topic/101858-how-to-replace-text-in-a-texarea/#findComment-521379 Share on other sites More sharing options...
skateme Posted April 23, 2008 Author Share Posted April 23, 2008 umm hello? Link to comment https://forums.phpfreaks.com/topic/101858-how-to-replace-text-in-a-texarea/#findComment-525031 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.