Can I run a PHP file from the cgi-bin?

Avatar
  • Answered
How do I point to my cgi library from HTML pages? For example, I have this code:

var client = new XMLHttpRequest();
client.open("POST", "/SCOMSTO/logger.php", true);

and it works on another server because there is a mapping directive that maps /SCOMSTO/* to /u/scomsto/cgi-bin/*


Similarly, in another HTML page I have:

Avatar
Tim S.
Hi SteveC, Thanks for posting your question. I'm more than happy to assist you today. If you are on a VPS or Dedicated hosting plan you can contact our support department to have a symlink set up. If you are on a shared hosting package, you'll need to store the cgi scripts in the cgi-bin folder in the public_html folder. Then you'll need to update your path in your code to reflect the path to the cgi-bin. If the HTML page calling the script is in the public_html folder, the path would be:

var client = new XMLHttpRequest(); client.open("POST", "/cgi-bin/logger.php", true);

I hope this helps! If you need further assistance please feel free to contact us. Thanks! Tim S