Page 1 of 1
How would I use php to make forum posts on other sites?
Posted: Mon Jul 14, 2008 9:51 am
by coondog
how would i use php to make forum posts on other sites?
like logging into a site, storing a cookie(s) and then sending post data
Re: How would I use php to make forum posts on other sites?
Posted: Mon Jul 14, 2008 9:59 am
by pickle
Why would you want to do that? Seems a lot like a way to create lots of SPAM?
Re: How would I use php to make forum posts on other sites?
Posted: Mon Jul 14, 2008 10:02 am
by Dynamis
I made something of this nature a few years back. As far as I know though, you must log into each webpage that you want to post on first, and then you can post to them from your site. So one possible way of doing it would be to include all the other webpage logins on your page, log into all the sites you want to post on, and then have a form on your site that you could fill out and would submit to the correct site(s).
Also, you can get the form action tags from the page source of the webpages that you want to post on.
Re: How would I use php to make forum posts on other sites?
Posted: Mon Jul 14, 2008 10:53 am
by coondog
pickle wrote:Why would you want to do that? Seems a lot like a way to create lots of SPAM?
don't worry pickle, I could contact the other forum(s) and ask them if it's alright first.
but there are various ways this kind of stuff could be used, for one you could use it like if you had a network of forums and wanted to post on them all for when you make announcements
is there a function you can use in PHP to store a cookie on the host server and a function to send post data to a different server?
Re: How would I use php to make forum posts on other sites?
Posted: Mon Jul 14, 2008 10:58 am
by pickle
cURL
Re: How would I use php to make forum posts on other sites?
Posted: Mon Jul 14, 2008 11:01 am
by Dynamis
To send post data to a different server, you just put the server process page in your form action tag.
Example:
http://www.example.com/index.php has a form you want to submit to. Upon viewing the page source you find <form action="process.php" ...
So based on this, your form on your site should be
<form action="
www.example.com/process.php" ..
This will make process.php on
http://www.example.com process your form upon submission.
Re: How would I use php to make forum posts on other sites?
Posted: Mon Jul 14, 2008 12:44 pm
by coondog
Dynamis, sending post data isn't too hard, but how do I retrieve cookies?
Re: How would I use php to make forum posts on other sites?
Posted: Mon Jul 14, 2008 1:04 pm
by Dynamis
I guess I'm not sure what you are trying to do then. Why do you need to retrieve a cookie? If you are just posting onto another site, you shouldn't need to mess with cookies, and not all sites use cookies anyway, so this would not be efficient.
Re: How would I use php to make forum posts on other sites?
Posted: Mon Jul 14, 2008 1:12 pm
by coondog
well you have to be logged into atleast one of the sites, so just sending post data isn't enough, I need to use cookies
Re: How would I use php to make forum posts on other sites?
Posted: Mon Jul 14, 2008 1:39 pm
by Dynamis
Is including the page log-in in a tiny port of your page not what you are looking to do? No matter what you are going to have to log in to the webpage. So if you include the log-in in an iframe on your page, then once you log in to the site on your page, you should be able to post. This way you need not do anything with cookies. Would this suit what you need? Need an example?
Re: How would I use php to make forum posts on other sites?
Posted: Mon Jul 14, 2008 1:49 pm
by coondog
I don't mean to have the cookies stored on the client computer(like my computer), but instead on the server computer
Re: How would I use php to make forum posts on other sites?
Posted: Mon Jul 14, 2008 2:10 pm
by Dynamis
By including the login in an iframe on your page, once you log in on there, you can do anything on your page and still be logged into that website. So posting to their site would work. Its just like you could go to their site, log in, go back to your site and still post because you would still be considered logged in, in most cases, until you close your browser.
So, you didn't really answer my question but I think I answered yours. The two ways I know this will work are:
1. Include their login on your page in an iframe. This will allow you to log in on your page, to their page, and then immediately post from your page to their site.
2. Go to their site, log in, go back to your site, and then post to their site. This works w/ cookies for sure, not 100% on sessions though. May need to use option 1 for sessions.
Does that help? If not, please go into more detail with what you want to do.