I can read and then display some web pages using PHP and cURL, but some web pages I cannot do this. For example, the following PHP code works great to display example.com in-browser (running my PHP code from an APACHE server):
<?php $curl = curl_init(); curl_setopt ($curl, CURLOPT_URL, "http://www.example.com"); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec ($curl); curl_close ($curl); print $result; ?>
But the URL I really want to access is the login page of my FileMaker database, running on a shared server via IWP (Instant Web Publishing). Here is the code I am using which results in a blank browser page:
<?php $curl = curl_init(); curl_setopt ($curl, CURLOPT_URL, "http://hartford.macusa.net/fmi/iwp/cgi?-db=Install_Info.fp7&-startsession"); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec ($curl); curl_close ($curl); print $result; ?>
That page on macusa.net uses a cookie, so perhaps that is causing the blank browser page. When I manually type the above macusa URL into the Safari address bar and hit return, the Console shows me the following:
Set-Cookie fmi-cookie=fmi-cookie; Path=/; Version=1
Assuming it is the cookie causing trouble, what approach should I take to solve it?
I am still learning PHP, so for now I simply want to display the desired page contents in the browser, to show me that at least I can access the page content via my PHP code. My ultimate goal, however, will be to quietly access the login page via PHP, then present the user with the same page but translated into Japanese, from which they should be able to enter their ID/PSW, submit the form, and access the database. And if the login attempt throws an error, I would grab that with PHP and then return a translated page for the user. The reason is because the shared server that hosts my FileMaker database is set to an English UI, and I wish to translate the login page (and any errors) into Japanese.
dynamo mailing list
Update your subscriptions at: