Copy link to clipboard
Copied
Hey again, I didnt want to post anything else here cuz people have helped me so much already.
Ive been trying for hours to figure this out, I got it working before but now its suddenly not working ![]()
The email form doesn't work anymore
This is supper annoying as this is how my clients reach me. I dont know how many lost emails I have ![]()
Anyway, the email form used to work, and now it just doesn't. It says the email has been sent successfully, but no email gets sent to my account.
Any ideas?
my site is: theosparks.co.uk
Thank you guys, your the best.
There should be error messages somewhere, if it truly is not working. Error console in the browser (F12 for most browsers). Error log in the Apache logs. Something displayed in the browser screen. Something indicating where the trouble is.
Another thing that makes me curious is: is the form located in the same folder as the action page (contact_me.php), or one level up? But then if it were not just outside your "mail" folder, you'd be getting a "page not found" error, so I'm going to assume
...Copy link to clipboard
Copied
Looking at line 317 of your code, I see a form, but I don't see any action to your form. Based on the comments I see in the code, you should have a form action defined that points to the URL of your PHP processing script. There's likely just a simple javascript that is clearing the form and displaying the confirmation div so you see the message and the form clears, but this is why nothing is happening on the backend.
Copy link to clipboard
Copied
Okay, thank you for looking over it for me.
So do you know what form action and how to point it to the PHP script? I don't know how its disappeared, like I said it used to work.
Copy link to clipboard
Copied
theos71901143 wrote
Okay, thank you for looking over it for me.
So do you know what form action and how to point it to the PHP script? I don't know how its disappeared, like I said it used to work.
Look at line 315 of your code. It appears you copied in the form code from somewhere because of the instructions there telling you to edit line 19 of your PHP document to tell the script where to send the email to. Just make the form's action that PHP file. I am assuming there is also somewhere in that document that will tell you where to have the form submitter redirected after it is complete.
Copy link to clipboard
Copied
Heya, I understand what your saying and I think it makes sense. So I need to link this form to the php file somehow? In the php file I have already included my email address in the correct place, so thats already done.
How exactly to I make the forms action the php file?
Copy link to clipboard
Copied
heya, sorry i accidentally marked this as answered somehow, still cant figure this thing out.
I understand what your saying and I think it makes sense. So I need to link this form to the php file somehow? In the php file I have already included my email address in the correct place, so thats already done.
How exactly to I make the forms action the php file?
Copy link to clipboard
Copied
For the form tag you are missing action="". Inside the quotes should be the path to the PHP file. That will execute the PHP file when the form is submitted. If you don't feel comfortable editing the code, I would highly recommend looking into form solutions. There are simple ones like wufoo ( Online Form Builder with Cloud Storage Database | Wufoo​ ) that give you the exact code to copy/paste into your website to make forms work without having to go into the code view.
Copy link to clipboard
Copied
Heya, I tried this, I added action="mail/contact_me.php" to the other bits at the top of the form, so it looked like this:
<form name="sentMessage" id="contactForm" action="mail/contact_me.php" novalidate>
Still nothing
Am I doing something wrong?
When I get this problem fixed, I will look into alternative ways to make my website as I dont know anything about code.
Thank you for all your help so far.
Copy link to clipboard
Copied
Saying it doesn't work doesn't help us to help you.
Did you upload the revised form and script (mail/contact_me.php) to your server ?
Are you testing the form on the live site and not locally?
Copy link to clipboard
Copied
No I upload it to the server every time I test it.
Copy link to clipboard
Copied
There should be error messages somewhere, if it truly is not working. Error console in the browser (F12 for most browsers). Error log in the Apache logs. Something displayed in the browser screen. Something indicating where the trouble is.
Another thing that makes me curious is: is the form located in the same folder as the action page (contact_me.php), or one level up? But then if it were not just outside your "mail" folder, you'd be getting a "page not found" error, so I'm going to assume that the hierarchy is proper.
V/r,
^ _ ^
Copy link to clipboard
Copied
Oh, and one more thing.
If you are basing your allegation of it not working purely on the fact that it says the email was sent, but you don't receive the email, then the issue may not be your code, it could be your email server, or something that happens AFTER the email is successfully sent.
Just a thot.
V/r,
^ _ ^
Copy link to clipboard
Copied
<form action="[actionfile.php]" method="post" name="sentMessage" id="contactForm" novalidate>
Copy link to clipboard
Copied
I tried this, I replaced this:
<form name="sentMessage" id="contactForm" novalidate>
with this:
<form action="mail/contact_me.php" method="post" name="sentMessage" id="contactForm" novalidate>
I tried a few variations and nothing worked ![]()
Thank you though
Copy link to clipboard
Copied
Contact your web host and ask them which form-to-email processing scripts you can use with your hosting plan. Some hosts have scripts already installed on their servers that you can activate from your server's admin panel. If your host doesn't support scripts, you could use a service like Wufoo.com
Copy link to clipboard
Copied
Heya Im not sure if its a server issue, I had a problem with the email form ages ago and phoned them up and they said theres no reason it shouldn't work on their end, and that they cant help me with the code for my website.
In the end I got it working and it had nothing to do with the server. I only noticed this isnt working after updating my website so I guess something I did messed something up. ![]()
But thank you
Find more inspiration, events, and resources on the new Adobe Community
Explore Now