View Full Version : Please anyone help with Contact Form
jen
16th February 2006, 19:04
Hi,
Please can anyone here would be so kind to help with putting together a contact form.
Trying to get a contact form for a website. Been trying to sort this out but to no avail. :cry:
Many many thanks in advance.
Regards.
DarrenC
16th February 2006, 19:31
Jen,
Does your hosting company not have any scripts like formmail? Alot of the UK hosting companies do, and it's simple to implement.
I'm snowed under at the moment, otherwise I would help you.
Darren
kartel
16th February 2006, 22:14
I know some have a form generator as a script but its pretty basic
DarrenC
16th February 2006, 22:27
No this isn't a form generator, its a script which sends mail from the form to your email inbox, and you copy the HTML on to your page, and play around with.
I used it for a few forms on my site.
Now though, I use PHP forms, which tend to be a little more secure.
JR
17th February 2006, 09:34
Hi
This is a doddle - I have used it on a number of my sites and it works a treat.
http://www.tele-pro.co.uk/scripts/contact_form/
John
creospace
17th February 2006, 09:41
Is this the same jen I did the small php form for on the parenting site?
Gary
Ravenfire
17th February 2006, 11:05
Yes I think it is, Jen posted a while back about this form I think. From the looks of the one on the site some of the code is missing.
creospace
17th February 2006, 11:09
ok , well i guess maybe it's been deleted or something or maybe played with , I left it all commented so they could replicate it :)
Jen, feel free to get back in touch if you want me to fix it :)
Gary
jen
17th February 2006, 11:11
Hi everyone,
Thank you so much for all your replies and advice. We actually already have a form created, yes we did go to that telepro that John mentioned but it doesnt seem to work.
Gary,
Hi yes it was me and the form that we've had redone by you works perfectly fine (thank you) and in fact we've tried to do is copy the exact code and change some variables as it is for our other site but it doesn't seem to get anywhere, it comes back with all the codes goodness knows. I'll PM you the form if you don't mind.
Thank you all guys.
creospace
17th February 2006, 11:29
Problem semi solved - it would appear there is no php installed on the server so it's just showing the code rather than parsing it.
Gary
JR
17th February 2006, 11:43
Hi Jen
Works like a charm and generates the html and the php. Still as long as others have sorted you out that's cool and why we are here :)
<form method="POST" action="contact.php">
Fields marked (*) are required
Salutation:
<input type="text" name="Salutation">
<input type="submit" name="submit" value="Submit">
</form>
Created by <a target="_blank"
href="http://www.tele-pro.co.uk/scripts/contact_form/">Contact
Form Generator</a>
<?php
// Website Contact Form Generator
// http://www.tele-pro.co.uk/scripts/contact_form/
// This script is free to use as long as you
// retain the credit link
// get posted data into local variables
$EmailFrom = "john@this address.com";
$EmailTo = "john@anotheremail address.com";
$Subject = "Hello form the web";
$Salutation = Trim(stripslashes($_POST['Salutation']));
// validation
$validationOK=true;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}
// prepare email body text
$Body = "";
$Body .= "Salutation: ";
$Body .= $Salutation;
$Body .= "\n";
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
jen
17th February 2006, 18:08
Hi guys,
Thank you so much for all your response and help. Gary pointed out about php script is not parsing (is that right Gary). We've worked it out ourselves instead of waiting for our host to reply, we checked what the set-up for the other site is and indeed that was the problem, site 2 was not set to enable php. As simple and time consuming as that - if Gary hadn't pointed it out , I would be bald by now. :lol:
Thanks Gary once again and thank you everyone.