This may seem like a bit of a rollercoaster, but my intention for setting up a server with InfinityFree was to be able to host a PHP file designed for handling a form submission that would use PHPMailer to send the submitted form to a designated email.
This is for a portfolio-style site that I have built using Github Pages and deployed through Cloudflare, but due to the fact that Github Pages only supports static webpages I hoped that I would be able to use InfinityFree to host the PHP functions/dependencies needed to handle form submission.
I’ve read a few other forum posts that talked about varying issues with using the unsupported mail() function and others regarding PHPMailer but I still can’t seem to get my form submission to work. I’ve double-checked the connection between my Cloudflare server and InfinityFree server, uploaded all files and directories relevant to the form onto my InfinityFree server, and made sure the form was connected with action="https://benmakesmedia.wuaze.com/contact.php" but the only thing I get is a Timeout error message from Chrome.
I’m not quite sure where things are going wrong, but if any additional code snippets or images are needed for the sake of clarity, please feel free to ask.
I had a quick look at your accounts, and I can see the domain benmakesmedia.wuaze.com has already been deleted from your account. So if you’re still using the domain in your code, then that’s why.
From here, you can either add the domain to your account again or use a different domain on your account. I see you have added a custom domain to your account too, but that domain is behind Cloudflare and doesn’t appear to be linked to our hosting.
So best I can tell, you don’t have any website that’s actively hosted with us, so there is no way to access your PHP mail form.
Please note that you may want to use your custom domain or a subdomain of that domain for this and host it behind Cloudflare. Because we have a browser validation system that will block direct form submissions from other websites.
I’m curious as to why it says that benmakesmedia.wuaze.com has been deleted when this is what I see from my account’s control panel:
The only website I see on my control panel is the custom domain that I attempted to connect, but from what you’re saying it seems like that connection failed. Is your advice to go directly through Cloudflare and forget about trying to host my PHP files on InfinifyFree?
Note that the account label has nothing to do with the account contents, you can set that to whatever you want. Select that account and navigate to the Domains section, there you will be able to see (and add) domains on/to your account
Right, I apologize, that screenshot doesn’t show that under Domains I currently have the domain name benmakesmedia.com listed.
Clicking on that brings me to the domain control panel where I can see that I have a green checkmark for Directory Exists and a confirmed file for Index File. I also have an Active status for SSL and a few red notifications for DNS Status but since it says:
This is OK if the domain is set up on your hosting account and your DNS settings at Cloudflare are correct.
then I assume the Cloudflare DNS settings I have configured are enough.
Everything regarding the static elements being served via Github Pages works without issue, and going to the URL benmakesmedia.com also works without issue. When I try to access the domain benmakesmedia.wuaze.com or any of its branches I just get a timeout error from Chrome.
I will probably be rethinking my strategy for this form submission and rather than attempt to deploy my own PHP file for handling mailing functions, I’ll just use a 3rd party API like Web3Forms or something similar.
I’ve made the necessary changes to the routing path for the forms action, but I’m now hitting the error message from Github Pages preventing my PHP script from running.
I don’t think this is an issue from the InfinityFree side of things, so I will have to review what I’ve written so far and see if I can get these two things to cooperate with one another.
Please remember that a website with a particular hostname can only be hosted with one hosting provider at a time. If the website for benmakesmedia.com is hosted with GitHub Pages, then the website isn’t also hosted with us. Simply adding the domain to our platform doesn’t route your website traffic to us. And from the DNS level at Cloudflare, you can only direct your website to GitHub or to us, and not both.
If I may offer a suggestion: perhaps you could setup a subdomain like form.benmakesmedia.com or contact.benmakesmedia.com on our platform, and then direct traffic from that subdomain to our hosting in Cloudflare’s DNS. That way, your main site can be hosted at GitHub Pages, and when people enter the contact form, you can send them to the subdomain with us.