Reputation: 13517
I have a problem where the server I'm using is not configured to allow PHP or CGI and I need to send a mail using variables received from a form on this server to the owner, like a general enquiry/feedback form.
Does anyone know how I can call a simple PHP file on another domain configured to use PHP and then execute the mail()
function on that server with variables passed to it from my non-PHP/CGI server?
How do I enable cross-domain AJAX calls without the originating server having PHP/CGI enabled?
Any feedback/advice would be greatly appreciated.
Upvotes: 2
Views: 778
Reputation: 449613
It's probably somehow doable using JSONP, but you don't need Javascript for this. The much easier solution would be to place the sending PHP script on the remote server, e.g.
www.serverwithphp.com/send.php
and then to point the feedback form directly to that script:
<form action="http://www.serverwithphp.com/send.php" ....>
and have send.php
do a header redirect back to the original site after sending:
header("Location: http://www.serverwithoutphp.com/thanks.htm");
die();
Upvotes: 2