PDA

View Full Version : Contact Us Form



Sony.Com
11-01-2007, 08:30 PM
Hey,
I was wondering if someone could give me the code for a contact us script.

+Rep will be given.

Thanks
Joz104

Lysine
13-01-2007, 12:49 AM
call this file contact.php




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

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Email Form </title>
</head>
<body>

<form method="post" action="sendeail.php">

<!-- DO NOT change ANY of the php sections -->
<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>

<input type="hidden" name="ip" value="<?php echo $ipi ?>" />
<input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
<input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />


Your Name: <br />
<input type="text" name="visitor" size="35" />
<br />
Your Email:<br />
<input type="text" name="visitormail" size="35" />
<br /> <br />
<br />
Attention:<br />
<select name="attn" size="1">
<option value=" Sales n Billing ">Sales n Billing </option>
<option value=" General Support ">General Support </option>
<option value=" Technical Support ">Technical Support </option>
<option value=" Webmaster ">Webmaster </option>
</select>
<br /><br />
Mail Message:
<br />
<textarea name="notes" rows="4" cols="40"></textarea>
<br />
<input type="submit" value="Send Mail" />
</form>

</body>
</html>


Name this file sendmail.php


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

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sendemail Script</title>
</head>
<body>

<!-- Reminder: Add the link for the 'next page' (at the bottom) -->
<!-- Reminder: Change 'YourEmail' to Your real email -->

<?php
if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo "<h2>Use Back - Enter valid e-mail</h2>\n";
$badinput = "<h2>Feedback was NOT submitted</h2>\n";
echo $badinput;
}
if(empty($visitor) || empty($visitormail) || empty($notes )) {
echo "<h2>Use Back - fill in all fields</h2>\n";
}

$todayis = date("l, F j, Y, g:i a") ;

$attn = $attn ;
$subject = $attn;

$notes = stripcslashes($notes);

$message = " $todayis [EST] \n
Attention: $attn \n
Message: $notes \n
From: $visitor ($visitormail)\n
Additional Info : IP = $ip \n
Browser Info: $httpagent \n
Referral : $httpref \n
";

$from = "From: $visitormail\r\n";


mail("YourEmail", $subject, $message, $from);

?>

<p align="center">
Date: <?php echo $todayis ?>
<br />
Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> )
<br />

Attention: <?php echo $attn ?>
<br />
Message:<br />
<?php $notesout = str_replace("\r", "<br/>", $notes);
echo $notesout; ?>
<br />
<?php echo $ip ?>

<br /><br />
<a href="contact.php"> Next Page </a>
</p>

</body>
</html>

Sony.Com
13-01-2007, 12:58 AM
Thanks!!

Is there such thing as a non php contact form?

My host doesnt support PHP:(

Sam
13-01-2007, 01:13 AM
No.

It needs PHP to be sent.

-1.
13-01-2007, 10:32 AM
No.

It needs PHP to be sent.

No, theres CGI Contact Forms, but they seem to be more compliated.

PinkFM
13-01-2007, 03:08 PM
Thanks!!

Is there such thing as a non php contact form?

My host doesnt support PHP:(

I can host it off habbofire if you want?

Sony.Com
13-01-2007, 03:30 PM
No, thanks anyway tho.

I just need a free/cheap host that has PHP.

beer
13-01-2007, 03:34 PM
www.addyour.net (http://www.addyour.net) :]. Not sure if its still up tho.

edit: thats down sorry. And im not sure which 1s support PHP.

Matt.
13-01-2007, 06:19 PM
http://www.kingofhosts.com
I have never used them but it says it supports php :).

ScottDiamond
13-01-2007, 07:25 PM
You can get a form at www.feedback.com (http://www.feedback.com) or something like that. Just google "Free feedback forms" and you can customize them, put the form on your website and it sends it to your email through their server.

Sam
13-01-2007, 09:05 PM
Well yeah.. But thats more advanced :P

Plus i didnt know =[

Replicada
13-01-2007, 10:32 PM
I can give you php 4.4.4 supported hosting if you wish ?

Paypal only though.
PM me for more info

Sites I own:

replicada.com
habboshack.com

Check the php scripts on them for proof.

Matt.
13-01-2007, 10:36 PM
You can get a form at www.feedback.com (http://www.feedback.com) or something like that. Just google "Free feedback forms" and you can customize them, put the form on your website and it sends it to your email through their server.

:o, I remember that. The site is www.freedback.com.

Rob
14-01-2007, 12:18 PM
You can make ASP forms. I've made one before but my pc had to get wiped so I lost it. And I can't remember much asp code now, sorry.

Thanks,
Rob

ScottDiamond
14-01-2007, 12:23 PM
:o, I remember that. The site is www.freedback.com. (http://www.freedback.com.)

Yeah that's the one :P

beer
16-01-2007, 05:17 PM
Ive just remembered there are HTML ones. Ive 4gotten URL. I used it 4 my old site.

Damn wish I could remember it. It was pretty good.

Want to hide these adverts? Register an account for free!