PHP Question

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
Watch

jroy

VIP Member
Impact
13
Ok, I was just wondering if it was possible to code a php script to take a username and password and then open up a page on another site, insert the data into a log in page, and depending on what the page does return a message. I assume this would be like making a spammer, with PHP, to sign up on various sites and post shit. I'm not making a spammer, just testing one of my ideas. Any help would be great.

Thanks,
Josh
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Sure, you need curl for that purpose
 
0
Close
Will this actually use the other page? I can't just submit form data to the page, its a secure server (https).
 
0
Close
Use my cURL class.
http://www.ruuma.com/s/class.curl.phps

PHP:
<?php

include('class.curl.php');
$curl->set_https();
$data = $curl->post("https://somesitehere.com", "username=Admin&password=moo");
echo $data;

?>
 
0
Close
Ok, thanks, but when I use that all it returns is a 1, no matter what the password is. If there is no password then it just brings up the login page. Any idea why?
 
0
Close
Well, you need to set the URL portion of it to the form's action URL.

Then you need to use the correct input field names to make it work. (<input name="pass" ...> or something.) It might not be username and password. There could be other fields you need to fill out, too.
 
0
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back