Whats the best way to get Samba Entity Data onto a webserver with strict network policies

I agree. I had not thought of doing this before, and I didn’t really have a clear methodology in my mind on how to accomplish the task. But I like this type of challenge, so I thought I would give it a shot even though I won’t use this in the near future, if ever.

I too think it is very awesomely, amazingly cool!

LOL ;P, thanks for that @pauln … I didn’t understand how it could be done, so I had to do a little research to figure out how to process Post data.

Knowing PHP fairly well, I figured it would be somewhat simple and easy to do, but at first I had a hard time finding the right “thing”. While it is straight-forward to process Post data from a Form Submission using $_POST["form_element_name"], that wasn’t going to work in this case, because that is looking for a certain type of encoding, and we don’t have any of the form element names to reference, nor a “user” to click a Submit button ;).

What I was looking for is “sort of” like listening for something to happen behind the scenes, but with no user interaction like a Form Submission. And as I surmised earlier, we were not really “listening” for anything in the first place - we just needed to process the Post Data somehow. Given we have APIs all over the internet that allow for it, like @JTRTech’s PMI solution., I was confident there existed a method to do this.

I stumbled across the “key piece” a couple of times in my research without even realizing it and skimmed right over it. The “magic” is here:

file_get_contents('php://input');

That ^ thing is some sort of magical PHP thing that contains the Post data - in our case, the JSON string. I didn’t even read about what it was - I finally figured it must be something special when I saw it more than one time in different code-snippets and I just tried it. When I realized it worked, I did a bit more reading. You can read about it and other “streams” here …

http://php.net/manual/en/wrappers.php.php

… and here …

1 Like