cloudy cloudy

Author Topic: Ajax Access to App (Phone Gap)  (Read 409 times)

0 Members and 1 Guest are viewing this topic.

Offline Andrew Hudson-Smith

  • Posts: 157
  • OS/Browser:
  • Mac OS X 10.13.4
  • Chrome 65.0.3325.181
Ajax Access to App (Phone Gap)
« on: April 30, 2018, 08:26:56 AM »

Morning - I am trying to create a phonegap build of my WD/Ajax site. All complies fine but I'm having trouble pointing to the clientraw file. I found a thread on using a php file to point to the client raw (added my url into it below). This works for the remote access but turns out phone gap does not run php files so still at a loss as to how to get the ajax file to point to an external server.



Code: [Select]
# get/return clientraw.txt from a different host
$URL = ''; // make sure you don't use a parameter for this!

$clientraw = file_get_contents($URL);

if (strlen($clientraw) > 0 ) {
  # got contents .. echo and exit
  header("Content-type: text/plain");
  header("Content-length: " . strlen($clientraw));
  echo $clientraw;
} else {
# unable to get contents
  header("Content-type: text/plain");
  echo "\n";
« Last Edit: April 30, 2018, 10:19:27 AM by Andrew Hudson-Smith »