Which folder does BSS use for Preview? How do I reference a php file in Preview

I've read similar questions but not sure I understand?

I have a contact form, with js validation and php, the js works fine but I can't seem to find the php file in preview and/or publish?

So, which folder is BSS using for Preview, and can I add my php file there manually?

Similar with Publish (from BSS) does BSS know that I want to upload a php file, or is there no access to php in the BSS Publish process?

(I know I can upload an exported site to a test site on my server, but I'm looking for a simpler solution while I'm working on the code)

Php does not work within preview as it's not supported by this app.

This topic has come up many times if you do a search you can see the responses ?

Thanks Chris, As I said, I've read other responses.

What about Publish? Is there anyway to upload a php file there?

The only thing that I can suggest is that any PHP file references must be an absolute URI reference. So it must exist in an external environment to run.

For example http://www.domain.com/form-action.php

i.e. <form action="http://www.domain.com/form-action.php" method="post">

If that does work in a Preview session then once you've verified that everything you want is working correctly, you can then return it back to a relative URI for export.

i.e. <form action="/form-action.php" method="post">

I believe @jo might know if something like this works, maybe?


Unfortunately I don't think I've added any PHP to any of my clients sites at this point, haven't needed it which is good since I don't do it LOL. That system does work for a lot of things though, so it's possible it may work for PHP items as well. Give it a try and see would be my suggestion. I do use that system mentioned by Saj for galleries and some other files such as PDF links and so on and I've had good luck with it so far.

Thanks for that.

It dawned on me that Preview, and probably Publish, are running on node servers, so there is no running LAMP server to serve up php. (?)

In my case I just wanted to test locally because uploading php files to a public server is a bit of a pain. So I can do as saj has suggested and hardcode "localhost/mybssTestSite/contact.php" while running my XAMPP server on my local PC.

Would be good if there was a FAQ page to provide this sort of advice, especially with regard to php because a contact form is pretty much standard on websites.

I ended up solving this by installing uWamp portable server and creating a virtual host for my bss project. Could probably have done the same with Xampp?