Enjoy unlimited access to all forum features for FREE! Optional upgrade available for extra perks.

Contact.php problems

Status
Not open for further replies.
Joined
Jul 20, 2008
Posts
184
Reaction score
4
Hello all, I`m having problems with my contact form

The problem with the contact form is it doesnt seam to work all the time (works very rarely) and doesnt send an email to say thankyou for contacting us (set up in my microsoft office outlook somewhere that i cannot find for the life off me) is there something wrong with this?

HTML:
<?php 

$message= '<table width="98%" border="0" cellspacing="0" cellpadding="3"> 

<tr>
<td colspan="2" valign="top" class="arialblack">
<div align="center"><strong>Customer Details</strong><br><br></div></td>
</tr> 

<tr>
<td width="30%" valign="top" class="arialblack">Full Name:</td>
<td width="70%" valign="top" class="arialblack">'.$_POST['fullname'].'</td>
</tr>

<tr>
<td width="30%" valign="top" class="arialblack">Business Name:</td>
<td width="70%" valign="top" class="arialblack">'.$_POST['businessname'].'</td>
</tr> 

<tr>
<td width="30%" valign="top" class="arialblack">Address:</td>
<td width="70%" valign="top" class="arialblack">'.$_POST['address'].'</td>
</tr> 

<tr>
<td width="30%" valign="top" class="arialblack">Post Code:</td>
<td width="70%" valign="top" class="arialblack">'.$_POST['postcode'].'</td>
</tr>

<tr>
<td width="30%" valign="top" class="arialblack">Email:</td> 
<td width="70%" valign="top" class="arialblack">'.$_POST['emailaddress'].'</td> 
</tr> 

<tr>
<td width="30%" valign="top" class="arialblack">Phone Number:</td> 
<td width="70%" valign="top" class="arialblack">'.$_POST['phonenumber'].'</td> 
</tr> 

</table>'; 


$email = "info@#####.co.uk"; 
$emailm = "info@#####.co.uk"; 
$from = $email;
$subject = "#####.co.uk Enquiry";

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

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

header('location:http://www.#####.co.uk/thankyou.html')


?>

Thanks for any help
 
Just tried it about 20 times works fine, maybe a mail server issue?
 
Is this all of your code?

I haven't tried it, but with an initial glance; where are the form elements and submit button?
 
Last edited:
I presume this is the where the form gets sent to, I ran the file and it worked fine.
 
Hi this is just the contact.php file, the other part is fine and it all matches up, i think the problem lies in the bottom part
HTML:
$email = "info@#####.co.uk"; 
$emailm = "info@#####.co.uk"; 
$from = $email;
$subject = "#####.co.uk Enquiry";

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

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

header('location:http://www.#####.co.uk/thankyou.html')


?>

But i dont know what is the problem???

It does work sometimes but alot of the time it doesnt...

I could really do with a fully functional contact.php file that i could just take the bottom part out and change my email if anybody has one?

also how could i make it safer as well so i dont get spam?

Thanks
 
Thanks for the replys everyone, the contact form seems to work now!!! but it always seams to go to the thankyou page no matter what, wether the form is filled in or not, i have tried adding the captcha but it still always goes to the thankyou page just doesnt send the form details...

Is there anyway i can sort this out?

Thanks
 
Status
Not open for further replies.

The Rule #1

Do not insult any other member. Be polite and do business. Thank you!

Members online

Featured Services

Sedo - it.com Premiums

IT.com

Premium Members

AucDom
UKBackorder
Register for the auction
Acorn Domains Merch
MariaBuy Marketplace

Domain Forum Friends

Other domain-related communities we can recommend.

Our Mods' Businesses

Perfect
Service
Laskos
*the exceptional businesses of our esteemed moderators
Top Bottom