How to fill out "username" and "password" fields with PHP? - php

I want to scrape stats from an affiliate site with php.
I am pretty new to php but I know how to scrape data from a website, however affiliate sites need you to log in first.
How can I fill in the username and password fields and press the login button with php? Is it even possible to do this with php or do I need another programming language for it?

You'll have to analyze the whole login process by using the Developer Tools in Google Chrome or Firebug in Firefox to see what fields are posted (form data).
After that you'll need to develop a cURL script based on your research.

Related

Track user data from many websites using PHP

I have a landing page which embedded in many websites. It's role is to collect users data. I want to track these data to know from where each user come?
how can I do this tracking using PHP ?
There are Multiple ways to Check From which source user has submitted data. This is basically used in Analytics Platforms to gather statstics. Below are few of them
1) Put Google Analytics Code in the Landing page which is further embeded in to other sites. Later on Google Analytics Report you will be trace it. Also you will get other usefull reports too.
2) customised way - Fully under your control
A) Distribute your landing page in a way so every other site which embed your page get Unique Code and When submit the data you will get back that source along with other data this way you will be able to build your own tool
B) using $_SERVER['HTTP_REFERER'] to trace the routed page from anywhere along with appropriate query string
Other ways include throguh Javascript you can pass XHR request on load of your iframe but that will be complicated way if you can handle it properly than only go for it.

Mobile App Unique ID detection in PHP

I'm building a mobile app which will call a search engine on my website. I have PHP code to detect if a person is coming in through a Mobile device. However, I want to see if I can detect if they are coming in through my app versus a regular page browse.
In the past, I've had a hidden field on a form submission, but this is not feasible anymore.
I want to know if there is a way if somebody accesses a page on my website through the mobile app or a mobile browser?
One option is to pass a PHP $_GET parameter, but I'm looking for other solutions.
Perhaps override the user agent used in the mobile app, or send an additional header that your PHP scripts can look for
You can modify the default user agent to identify your application.

Can I use reCaptcha on PHP and ASP?

To be more clear, I have different forms on the website (it's my college's website), where they have all the forms on PHP but hey use an ASP engine to send all the info to the email assigned. My question is: on the Google website about the captcha it says to use the second code on a verify.php page but I would like to use the second code on a ASP engine. Is that possible? I tried everything, otherwise we will have to change all the engines we have to PHP.
It's completely possible. How to verify a reCaptcha attempt is publicly documented. The form post will have all the information you need to verify the submission about that individual user. You just need to share the private key between the two applications to make it work together.

external "booking tool" to allow login through external website

I have a booking tool which you "install" in an external website by inserting a single javascript from our server in your website and create a div node which we detect, when the javascripts loads, it executes a call to a webservice and then will load the html over a JSON response from our webservices and insert into the div node.
so basically, our tool "melds" with your website and we're very careful to namespace all our css and javascript to stop us from interfering with your website, to the point of a little paranoia :)
once our tool is installed, it runs all the webservices to our server to retrieve data.
the part I'm stuck on, is how to secure the login data, basically, we have a problem here, we don't know the people who own the external website and they are allowing people to register and login to our tool in order to buy our services, we store, process logins and give tickets to events and functions using that tool.
the problem we have is that those credentials can be stolen because the website has access to the html, javascript and probably can do some naughty jquery tricks to grab the username and password data.
I'd like to stop that if possible.
how could I secure the login, so I can embed the tool in any website (http or https) and protect the usernames and passwords entered into the tool and used to login.
any ideas?

PHP, Twitter and Facebook posting pre-populated form content posting to own wall

Not sure if this has been done before, but did some searching and could not find anything.
I would like to have an input box on my webpage, which has some pre-populated text and when a user clicks submit the text is tweeted on their own wall, this would be posted immediately if they have a twitter session open if not twitter will ask for the user to sign in. I guess this must be possible because it is similar to a share button.
Not being very good with twitter I'm not sure where to even start.
(Also if possible I would like to do the same but with Facebook as well).
Nb. App is to be developed using php.
Thanks
Both twitter and facebook have well-documented API to do this. However, you will probably need to use their system to have the user confirm what is about to be posted. You might also need to use some javascript, I don't the specifics of these API.
https://dev.twitter.com/
https://developers.facebook.com/
You cannot do this on facebook. We do not allow pre-filling of the message param on dialogs.

Categories