Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

contact form not working on my new server

Featured Replies

Hi guys, bought a new hosting server the other day, it supports php5 and its enabled on my server but for some reason my contact forms are not working when you fill the form in and click send, it gives me the error 500 message.

 

any advice on what might be wrong here?

 

PS i know the script works, believe me!

First try a simple script like

<?php
print "hello";
?>

 

Then put double forward slash '//' in front of anything you think is causing the problem in the script.

 

Or post the script here

What URI does the script send the form details to? Is it a rewritten URL? Most 500 errors happen because of a htaccess file not doing its job properly

I'd guess that your form processing is done using a cgi script that hasn't been uploaded on the new server, or has incorrect permissions set.

 

Also, check in your CPanel error logs (or alternative if you're not using CPanel) to see if there's any info in there about why this happens.

  • Author

i dont think the contact form is supported by php5. has php 5 posed a propblem for older contact forms?

Sometimes it's the simplest things. I had a hosting service with PHP 4 and forms worked, then when they upgraded to PHP5 the PHP didn't process at all.

 

I discovered that the old PHP code tags were

<? ........... ?>

 

but when I edited that to <?php ............ ?>

 

it all worked.

Do you have a .htaccess file in that folder? if so, what are its contents?Also with things like this you should really contact your hosting provider. It's highly likely they will solve it in no time

  • Author

i dont have a .htaccess folder at all. do i need one? if so how do i make one etc?

 

Im with fast hosts lol, ever tried ringing them? its hell! lol

Some hosts support PHP5, but have PHP4 as default. Try making a file named info.php and put

 

<?php phpinfo(); ?> inside and save it. If you then run this in the browser, it should tell you what version of PHP you're running.

  • Author

Some hosts support PHP5, but have PHP4 as default. Try making a file named info.php and put

 

<?php phpinfo(); ?> inside and save it. If you then run this in the browser, it should tell you what version of PHP you're running.

 

here it is :)click here

Oh god, yes fasthosts are a nightmare. They do have reasonable customer services but they sure as hell have crappy servers

  • Author

Oh god, yes fasthosts are a nightmare. They do have reasonable customer services but they sure as hell have crappy servers

 

lol when i bought my hosting package i couldn't upload anything, nothing worked

i rung them like 6 times to sort it and it finally got sorted after 5 hours of stress lol.

  • Author

can anyone help me get any further on this?

Can you post the script here?

 

It probably has to do with the processing part, because the form which is part of the same script displays fine; it's only when the form is submitted that you get the problem.

 

If I could have a look at the code, I should be able to tell you what's going on.

  • Author

hiya, this is the script on its own, nothing else but the contact form my contact-test.php page

 

 

<?php

 

if(isset($_POST['submit'])) {

 

$name = $_POST['name'];

$tel = $_POST['email'];

$email = $_POST['message'];

$request = $_POST['request'];

 

$to = 'aaron@ko-graphics.co.uk';

$subject = "The Following details were sent through the KO Graphics website contact form.";

 

$message .= "The Following details were sent through the KO Graphics website contact form.<br /><br />";

$message .= "<strong>Name:</strong> $name <br />";

$message .= "<strong>Tel:</strong> $tel <br />";

$message .= "<strong>E-mail:</strong> $email <br />";

$message .= "<strong>Request Details:</strong> $request";

$headers = "MIME-Version: 1.0" . "\r\n";

$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";

$headers .= "From: [KO Graphics appointment request] $name" . "\r\n";

 

mail($to, $subject, $message, $headers);

}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>KO Graphics | Home</title>

</head>

<body>

<div id="container">

<div id="contact">

<form id="form2" name="form2" method="post" action="contact-test.php"><table width="302" border="0">

<tr>

<td width="96">Name:</td>

<td width="196">

<input type="text" name="name" id="name" />

</td>

</tr>

<tr>

<td>Tel:</td>

<td><input type="text" name="tel" id="tel" /></td>

</tr>

<tr>

<td>E-mail</td>

<td><input type="text" name="email" id="email" /></td>

</tr>

<tr>

<td>Request Details</td>

<td>

<textarea name="request" cols="25" rows="3" id="request"></textarea>

</td>

</tr>

<tr>

<td> </td>

<td><input type="submit" name="submit" id="submit" value="Send" />

<br />

<br /></td>

</tr>

</table>

</form>

</div>

 

</div>

</body>

</html>

That script is fine. I would seriously recommend contacting fasthosts by phone or email. They're useless generally but they should get this sorted for you

  • Author

That script is fine. I would seriously recommend contacting fasthosts by phone or email. They're useless generally but they should get this sorted for you

 

 

thanks mate,

 

i thought there wouldnt be anything wrong with it. i contacted fasthosts and slowly...but surely...they are helping me lol.

Yup, the script is working fine here.

A 500 error is sometimes thrown when no address is supplied to the "to" parameter, but in this case there is one.

 

I have a feeling that Fasthosts may have blocked the mail() function to prevent spam, and only allow mail sent through SMTP.

 

Found this on Fasthosts which should help

 

EDIT: took too long to reply, good luck though!

Thats a good point MrBrightside (The blocking mail)

They do like to charge people for the ability of sending email through their SMTP

  • Author

Yup, the script is working fine here.

A 500 error is sometimes thrown when no address is supplied to the "to" parameter, but in this case there is one.

 

I have a feeling that Fasthosts may have blocked the mail() function to prevent spam, and only allow mail sent through SMTP.

 

Found this on Fasthosts which should help

 

EDIT: took too long to reply, good luck though!

 

 

is there anything i could put in my script from that link that will help me. im not good at php at all lol. thank you for your help :)

Something I saw when looking at your PHP Info is that there is no path assigned to SendMail.. which surely means if it was trying to send an email it would fail due to Send Mail not being enabled..

 

Take a look:

sendmail_from no value no value

sendmail_path no value no value

 

Just a thought.. maybe they havent configured their PHP.ini file correctly yet, although i see the server was built in May 2008!??

 

Top of the info page:

Build Date May 2 2008 19:36:50

 

Sorry if this is completely incorrect, just my two pennies :)

 

Chris

is there anything i could put in my script from that link that will help me. im not good at php at all lol. thank you for your help :)

 

 

Hello..this seems to be there server end issue..

 

Nothing on your end will help.

 

I hope they resolve this for you.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.