How can I run a PHP script with cURL code in a Safari extension? How can I run a PHP script with cURL code in a Safari extension? curl curl

How can I run a PHP script with cURL code in a Safari extension?


You won't be able to do what you want the way that you're doing it. In his comment, zneak is absolutely right. You're extension is running on the client-side while PHP runs server side. Your Javascript has no idea what to make of your PHP code.

As an alternative, your extension can fire off an Ajax request to a URL that can run the PHP code. I do this in one of my extensions where I have to make a service call. Works great.