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 Quote Link to comment 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? Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
thebadbad Posted April 19, 2008 Share Posted April 19, 2008 EDIT: Sorry, wrong topic AND gibberish. Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
skateme Posted April 19, 2008 Author Share Posted April 19, 2008 How would I implement that? Quote Link to comment Share on other sites More sharing options...
skateme Posted April 23, 2008 Author Share Posted April 23, 2008 umm hello? Quote Link to comment 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.