A very basic bit of html code to create a contact form on my website |
A very basic bit of html code to create a contact form on my website |
geordief |
Aug 25 2024, 10:18 AM
Post
#1
|
Group: Members Posts: 4 Joined: 25-August 24 Member No.: 29,227 |
I made my own website almost 20 years ago (just to point out that I do have basic html skills)
Actually at that time I just copied another website and changed the html for my purposes. I let it go over the past 5 years or so and I can see that the contact form does not work and I need to replace it with another. I don't have a secure site but I don't want my email address to be spammed and so I want to include a bit of protection with a small script. Can anyone help or point me in a good direction? I am struggling to create a php file that I have seen can be used with contact forms ( eg here : https://paperform.co/blog/html-contact-form/ ) When I fill out the that form I am redirected to the php file but I don't get an email even though my preferred email address is edited into the php file. Maybe it is simpler if I use a cgi-bin or even just a script on the actual html page? |
Christian J |
Aug 25 2024, 12:31 PM
Post
#2
|
. Group: WDG Moderators Posts: 9,743 Joined: 10-August 06 Member No.: 7 |
I don't get an email even though my preferred email address is edited into the php file. Have you uploaded the files to your web host's server? It won't work from your local file system. Also, does you webhost allow PHP (most paid ones do)? You can easily test that with a file called say test.php containing some simple code like: CODE <?php phpinfo(); ?> If PHP is supported, your browser should display lots of PHP configuration data when going to test.php on your website. QUOTE Maybe it is simpler if I use a cgi-bin Doubtful, that would depend on the script you used, and maybe on how the web server is configured. QUOTE or even just a script on the actual html page? You mean javascript? You always need some kind of server-side script (such as PHP) for email forms to work. You can use javascript to confuse spambots though. A simple email link instead of a form does work without scripting, but only for users with an email program installed on the device they browse with, and spam protection might be trickier then. |
geordief |
Aug 25 2024, 05:12 PM
Post
#3
|
Group: Members Posts: 4 Joined: 25-August 24 Member No.: 29,227 |
I don't get an email even though my preferred email address is edited into the php file. Have you uploaded the files to your web host's server? It won't work from your local file system. Also, does you webhost allow PHP (most paid ones do)? You can easily test that with a file called say test.php containing some simple code like: CODE <?php phpinfo(); ?> If PHP is supported, your browser should display lots of PHP configuration data when going to test.php on your website. QUOTE Maybe it is simpler if I use a cgi-bin Doubtful, that would depend on the script you used, and maybe on how the web server is configured. QUOTE or even just a script on the actual html page? You mean javascript? You always need some kind of server-side script (such as PHP) for email forms to work. You can use javascript to confuse spambots though. A simple email link instead of a form does work without scripting, but only for users with an email program installed on the device they browse with, and spam protection might be trickier then. Thanks a lot for your reply.Yes I have uploaded the html and the php files up to my server.(It dawned on me that I should do this after I had tried unsuccessfully on my local computer which had always worked in the past for basic html) Still ,it does not seem to work and I have just checked that my hosting company does apparently support php (https://www.whtop.com/review/iccmhosting.ie).Perhaps I am on a particular package that either does not support it or else I have to notify them to activate it ,possibly. I have actually uploaded 2 pairs of html/php files that I copied off separate tutorial sites on the internet. One of them keeps telling me that the "name is missing" even though I fill out all three fields whilst the other pair breaks down when it gets redirected to the php file (different eror messages) I also just uploaded a simple test.php file as you suggested and got the error message that " This page isn’t working www.mysite.com is currently unable to handle this request." Do you think I should contact my hosting company and ask them to check it or would it be simpler to run a Javascript since my main concern is that my email address not be spammed and I do not run a lot of business enquiries on the site.? Or is php safer for the very small number of customers I get? This post has been edited by geordief: Aug 25 2024, 05:15 PM |
Christian J |
Aug 26 2024, 04:59 AM
Post
#4
|
. Group: WDG Moderators Posts: 9,743 Joined: 10-August 06 Member No.: 7 |
I also just uploaded a simple test.php file as you suggested and got the error message that " This page isn’t working www.mysite.com is currently unable to handle this request." That was odd. If PHP didn't run you shouldn't get any message at all. QUOTE Do you think I should contact my hosting company and ask them to check it You can absolutely ask them if your hosting plan includes PHP. QUOTE or would it be simpler to run a Javascript since my main concern is that my email address not be spammed and I do not run a lot of business enquiries on the site.? Javascript alone can't send emails though. It takes a server-side script (like PHP) for that. QUOTE Or is php safer for the very small number of customers I get? With PHP you can hide your email address from spambots, though they can still use your form to send spam without needing to see your actual email address. But if such spam messages become excessive you can always add some tricks (using javascript) to block spambots later. |
geordief |
Aug 26 2024, 04:13 PM
Post
#5
|
Group: Members Posts: 4 Joined: 25-August 24 Member No.: 29,227 |
I also just uploaded a simple test.php file as you suggested and got the error message that " This page isn’t working www.mysite.com is currently unable to handle this request." That was odd. If PHP didn't run you shouldn't get any message at all. QUOTE Do you think I should contact my hosting company and ask them to check it You can absolutely ask them if your hosting plan includes PHP. QUOTE or would it be simpler to run a Javascript since my main concern is that my email address not be spammed and I do not run a lot of business enquiries on the site.? Javascript alone can't send emails though. It takes a server-side script (like PHP) for that. QUOTE Or is php safer for the very small number of customers I get? With PHP you can hide your email address from spambots, though they can still use your form to send spam without needing to see your actual email address. But if such spam messages become excessive you can always add some tricks (using javascript) to block spambots later. Thanks again . Well ,my plan now is to check my particular package to see if it includes php (I already know my hosting company does support php) and to approach them for advice if the php file I uploaded is not working . If my object is to simply show my email address to customers but not to bots (not even necessarily providing a contact form) is there any way to do that? For example, in "my day" there were tricks like writing mysite dot com instead of mysite.com but I imagine that the bots may have cottoned onto simple ruses like that. |
Christian J |
Aug 27 2024, 02:53 PM
Post
#6
|
. Group: WDG Moderators Posts: 9,743 Joined: 10-August 06 Member No.: 7 |
If my object is to simply show my email address to customers but not to bots (not even necessarily providing a contact form) is there any way to do that? For example, in "my day" there were tricks like writing mysite dot com instead of mysite.com but I imagine that the bots may have cottoned onto simple ruses like that. I've used javascript to scramble an email link for the last decade, and even today it's usually months between each spam mail. But the amount of spam may also depends on how visible a site is. If my site was very popular maybe my email scrambling would not be effective enough. And again, clicking on email links only works for users that have an email program installed. If someone only uses webmail, they need to copy the email address, log into their webmail account and paste the email address into a new message. |
geordief |
Aug 28 2024, 05:55 AM
Post
#7
|
Group: Members Posts: 4 Joined: 25-August 24 Member No.: 29,227 |
If my object is to simply show my email address to customers but not to bots (not even necessarily providing a contact form) is there any way to do that? For example, in "my day" there were tricks like writing mysite dot com instead of mysite.com but I imagine that the bots may have cottoned onto simple ruses like that. I've used javascript to scramble an email link for the last decade, and even today it's usually months between each spam mail. But the amount of spam may also depends on how visible a site is. If my site was very popular maybe my email scrambling would not be effective enough. And again, clicking on email links only works for users that have an email program installed. If someone only uses webmail, they need to copy the email address, log into their webmail account and paste the email address into a new message. Cheers.Yes I have found a bit of Javascript code.I can use that until I sort things out with my hosting provider and will switch to php if I find out from them that am properly set up for that.(I do have my own domain name) |
Lo-Fi Version | Time is now: 3rd December 2024 - 08:46 AM |