Looking In A Webpage for String
Moderator: General Moderators
Looking In A Webpage for String
ok for example we will take paypal, or whatever or any forum lets just say paypal cause everyone knows that.
ok when you login to paypal you either login or get a page saying invalid username and password, how do my php script detect when it says invalid im thinking looking in the source for the invalid string?
i have no idea what code to use please help thanks.
so again i want to detect when it has failed to login by anyway possible or using the suggested way above
thanks in advanced
ok when you login to paypal you either login or get a page saying invalid username and password, how do my php script detect when it says invalid im thinking looking in the source for the invalid string?
i have no idea what code to use please help thanks.
so again i want to detect when it has failed to login by anyway possible or using the suggested way above
thanks in advanced
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
$_SERVER['PHP_SELF'] contains the name of the script that you're running on your server, it won't contain the name of a script you're accessing (via fsockopen, curl, whatever).
How you'd do this depends entirely on how you're making PHP log into PayPal. If you're using Curl for example, your curl session will return a page of HTML, you could then use str_pos() to check if a particular string exists. Bear in mind though, Paypal (and lots of other sites) don't like people writing scripts to automate logging in, so they tend to put up barriers. Writing something that's robust enough to carry on working when they change things is hard work.
How you'd do this depends entirely on how you're making PHP log into PayPal. If you're using Curl for example, your curl session will return a page of HTML, you could then use str_pos() to check if a particular string exists. Bear in mind though, Paypal (and lots of other sites) don't like people writing scripts to automate logging in, so they tend to put up barriers. Writing something that's robust enough to carry on working when they change things is hard work.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
strpos() and/or preg_match()
What about this%AC
http://devzone.zend.com/node/view/id/1402
Kinda cool. I just kind of skimmed over it, so it may or may not be helpful to you. I'm too lazy to read the whole thing right now.
http://devzone.zend.com/node/view/id/1402
Kinda cool. I just kind of skimmed over it, so it may or may not be helpful to you. I'm too lazy to read the whole thing right now.
Sure do.
http://www.paypal.com/cgi-bin/webscr?cm ... ro-outside
There's also sample code available in the documentation for it.
http://www.paypal.com/cgi-bin/webscr?cm ... ro-outside
There's also sample code available in the documentation for it.