TopNavNewbie wrote:Sorry for the basic questions, but did you create the PHP code file in Notepad and then save it in the Scripts folder of your Flare project? If yes, where do you insert the PHP script in your master page? Was it in the header or closer to your HTML?
Also, in the PHP code you used, what are the variables that I would need to update with my own details? I presume the
$to = 'example@example.com'; part but any others too?
I think I can answer some questions
- yes, you create the PHP file in a text editor. Notepad will work if you do not have anything better. At least get Notepad++. If you want to dive in head first and do more with PHP get a real IDE, such as NuSphere's PHPEd (can get a bit pricey, but worth the expense). Unfortunately, the only decent somewhat free PHP IDE from Waterproof is no longer available. You could also use Eclipse if your are really interested in a lot of pain and frustration.
- PHP script is included in the body of a page, not the header. Typically, you paste that bit of script right into the page or write some PHP code to load the script from an external file to be executed right then and there.
- the only variable that needs changing is the email address. The rest for email server connections is configured in the PHP ini file.
You may want to browse the absolutely excellent PHP documentation at
http://php.net/manual/en/. W3Schools also has some decent basic guides on how to get started with PHP, see
https://www.w3schools.com/php/default.asp.
You will definitely need a web server with PHP enabled. Doing this for Apache is easy and well documented. IIS can also have PHP, but as anything with IIS it takes a team of IT experts to get it working...or maybe I'm just too dumb, your choice. There are instructions for IIS as well.
When the web server comes across the php tags in an html file to be served up, the server executes the script and returns the resulting html to the client.