CURL Post frontend security - php

Is it safe to use php curl posting to receive data from external site to frontend?
I must send with the curl post htaccess login details to get the data. Can those login details be hacked or seen from client side (ie. when client loading page where curl triggered?
What I know this far, its just server to server post so client can't see the details posted with curl (its done with php)?

Related

POST DATA SENT FROM AN ANDROID APP LOST DUE TO DOMAIN REDIRECT

My android app used to fetch JSON data through a POST request to the site https://example.org. Now the domain name has been changed to https://example.ac.in. I have hosted the old https://example.org to another server and gave it a redirect with a wildcard. My problem is, the post data being sent from the android app is lost and .ac.in domain is not getting the data but my app is getting a response from the new domain. I came to know that POST data lost during redirect. Please help me if there is any way around so that my app can send data to my new domain.
Please note, I can't change the app at this moment so making a GET request from the app will not possible as the app is being used by many users and the app is not in the app store.
Update : Making HTTP 308 redirect crashing the app.

How to secure requests between Android and PHP

So I've been literally 2 months searching for this but nothing... Basically I've got an Android app witch makes HTTP(S) requests to a PHP server. Let's say I've got a URL to get some information: https://example.com/username/check/whaterver/, to access this URL you need to send over a token that you get once you're logged in. I have everythig all set, the only problem is that I know that people can see the requests made from their phones, let's say: URL: https://example.com Form-data: token=5456432145. What I need is a way to send the token to the server without the user being able to see the token.
I am not asking how to make a HTTP request between Android and PHP, I'm asking how to ONLY accept HTTP requests from Android and PHP
You can use/create a cryptography to send to PHP server and from server to browser of device. A cryptography mode will encode your token code.
Like: token=5456432145 to token=D37AG3H7183BAD2E6DGAS

Send data to a server from a web mobile app

My question is, how can I send a data (for example a text box) from a web mobile app (cordova) to my own server and save that data in server?
I tried post method but I couldn't run it completely.
You have to use AJAX request to make post requests to the PHP server.
You can find a documentation Ajax request using pure Javascript here.
Or using Jquery Ajax API
Watch out for CROS and Acces Control if you are not in localhost.

Php server to server session management

I am trying to retrive XML from a site and process on my server. I can get the XML on my browser after I log in to the specific site. but I cannot do it by sending request from directly from server because the session is not available. How can I achive this
Assuming it's using basic auth you should be able to do this with curl setting a auth_user /password: http://php.net/manual/en/book.curl.php

Update Facebook status externally using PHP with username and password of an User

Is it possibile to update the status of facebook externally using a user's username and password with PHP. without any user interaction(like facebook connect).
Also without using curl.
I know there are come facebook mobile clients like snaptu. how do they access inbox, wall and our status just knowing the username and password.??
Thanks in advance
I don't know what you have against cURL, but you can do this with any HTTP client that can handle cookie (or that you can roll cookie support for).
However you should not even remotely consider doing this! Unless it's for a hacky script that will never leave your computer and that you use for your own account. You should never be asking for other peoples' passwords. Use OAuth.
Without using CURL or other POST requests it isn't possible.
How can you even think about not using cURL? All the FB API is exposed via HTTP, and if you don't end up using cURL, you will use HTTP anyway, and construct the HTTP request manually and send it via bare sockets.
And that's where cURL could use your job. But it's basically the same.
The apps you're mentioning are screen scraping the FB website and send the HTTP request accordingly - with cURL.

Categories