Can I use reCaptcha on PHP and ASP? - php

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.

Related

Developing REST API using PHP

I am new in API. I am supposed to develop an API that allows our content provider to give information pertaining soccer whereby he is supposed to create matches,update matches etc .I would like to know how to create a REST API in php that allows a client to enter the information. So far,I have created an API but I dont know how to enable the client enter the information.
Informations:
It is the basic form that you have to create and then you must allow the user to submit the form datas that he/she has filled and you have to post the data to the route that you have created.
You must submit the data and then you have to make the submitted data to be json_encode() so that it will work for the API.
Or Else if you are not designing the form and other such things you can directly go in for the API ADD ONS that the Firefox and the chrome has . Assuming you are using the chrome or Firefox as browsers.
https://addons.mozilla.org/en-US/firefox/addon/restclient/
https://addons.mozilla.org/en-US/firefox/addon/rest-easy/
https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en
Okay, assuming that you created a REST API already, download the Advanced REST client chrome extension: https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo
I hope that answers to your question.
P.S: May I know what framework did you use to design your REST API ? Additional details can help you further.
Building REST APIs is atually a rather easy task. That's primarily what I work on at work all day. If you have to use PHP (I'm a fan of PHP, so don't take that comment the wrong way :) ), I would reccommend using a framework like Laravel.
The logic to handle the information once it's requested wouldn't change. You would just need to make your requests/responses REST compliant.
Here is a great tutorial for doing just that!
Also, since you use Yii, this tutorial is probably better. I've never used Yii, so I can't really vouch for it, though.

Send Contacts to Freeshbooks using PHP

Is there any way to send contacts(Name,address,Phn etc) to Freshbook using PHP ? I Am using a Form to get details from the user and i need to create a "client" in freshbook using this form field values . Is it possible ?
As you can see in the freshbooks developer site, there is a service for creating clients.
Since you were asking specifically about PHP, here's some sample code reference from the developer site. Some of the references are in PHP, and you'd probably have to adapt one of them to make it do exactly what you need.

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.

how to login to another site via PHP

I wanted to find out how to login to another site via PHP... I don't know the proper term for it, but basically, I want a user to be able to enter their login information for another website on mine, and interact with it through mine.Is there any tutorial?
thanks
There are few ways to do the job (actually, you just need to send POST data to the other site).
You can use :
curl (example: http://davidwalsh.name/execute-http-post-php-curl),
stream context (example: http://php.net/manual/en/function.stream-context-create.php),
or directly with sockets (example: http://www.jonasjohn.de/snippets/php/post-request.htm).
curl will do that PHP, cURL post to login to WordPress
but you will need that installed on the server which is sometimes not an option. There is however loads of scripts that can do the same thing as curl without the curl libs installed, eg: cakephp's HttpSocket class
as already stated, Curl will do that.
But you can also check out this PHP Class that makes everything easier and gives you a lot of automation out of the Box
Including Prefilling of CSRF Token, finding of all input fields, retrieving of details from the designated site. etc
the class can be found Here. Crawl Engine

sending a long link in an email using PHP

I am trying to implement a website which among other things, let users invite other users to specific pages. Unfortunately the link address of those pages are fairly long, and often cross the 70 characters limit. SO when I add them to the mail, even if I start a new line before the link, still the link address is cut halfway, and then the email client (gmail, for example) assumes the link ends at the end of the line. SO when the user clicks on the link, they experience it as broken.
I am coding all this in PHP, but the problem seem to be general.
What is the standard solution to this problem?
Place the URL in <> brackets. Most mail clients will parse the URL correctly and make it clickable, even when wrapped.
<http://www.somereallylongdomain.com/somereallylongdirectory/somereallylongfilename.html>
You could use a URL shortener to redirect to the longer links. Bit.ly has an API with which your code can interface for this purpose.
I don't know if there are better solutions, but you can implement a url shortener with http://yourls.org/ or with other tools...
Create your own URL shortening solution. There are several ways you can go, depending on the complexity of your requirements:
if you're using only a few selected urls which are always repeating, use apache rewrite
if the url is user specific or changes in other ways from case to case, use a database table that stores a short url and the original url
if you don't want or can't implement your own solution, use an existing url shortening service via an API, but make sure not to expose security relevant information

Categories