0

I'm trying to get a file by file_get_contents() from server , but the url needs authentication that is an ID , i dont know how may i integrate that id in my request .
if i browse the url from my browser it redirects me to login page and wants me to enter the ID (15 digits id) , then i can download the file. I've read this and this , but these solutions are for time we have a user&pass . how about my case that i have only one ID to get authenticated?

Community
  • 1
  • 1
alex
  • 7,551
  • 13
  • 48
  • 80
  • I don't get it, it sounds like you have an API key type idea that you want so the user would send your server this string by any means: `http://www.example.com/api/?apikey=123a123b123c123&file=123` and then you have logic that checks your database for a proper key, and if the key is good, you send the file `123 `. Is that what you are looking to do? – Rasclatt Nov 25 '16 at 19:46
  • no . I'm talking about getting a file from server A to server B that only authenticated users have access to. and the authentication form only has an ID field to be filled by user (this id says to server that this user is a valid user or not). if i want to do this process manually i will be redirected to login page and after filling the ID field and pressing login button , i can get the file. i want to do this process(authentication and then getting file) on a server . so now server A wants to download a file from server B that needs authentication . how may i do that? – alex Nov 25 '16 at 20:11

0 Answers0