How to make a php robot that can log in?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
QueenZ
Forum Newbie
Posts: 2
Joined: Wed Feb 22, 2012 2:18 pm

How to make a php robot that can log in?

Post by QueenZ »

Hello,
I need to make a PHP script that logs into my Wordpress blog Admin panel /wp-admin/ (given the username and password) and then goes to .../wp-admin/user-new.php and automatically creates/adds a new user with the given details.

How is this done? Could you give me an example? Thanks!
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: How to make a php robot that can log in?

Post by Eric! »

You'll have to use cURL and it's a pretty complicated task to do from scratch if you don't know cURL or the guts behind how web forms works. Since Wordpress is everywhere these days you might find a wordpress demo written in cURL out there on the internet to help speed you up. A quick search revealed: http://stackoverflow.com/questions/7282 ... -wordpress
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: How to make a php robot that can log in?

Post by Celauran »

This sounds like an unnecessarily convoluted solution. Any reason you don't want to add the user directly into the database?
Post Reply