• 0

Contact Form Scripts


Question

I need support, for some reason, every single form script includes an error in each site I go. So if anyone would be kind enough to make or find a script that acutally works!

My website is: spywareguide.tk

I am trying to make a table such as:

Name:

E-mail:

Comments:

My contact is spywareguide@gmail.com

If anyone would like to help me, thank you!

I tried both .htm and .php, and still does not work.

Link to comment
https://www.neowin.net/forum/topic/317823-contact-form-scripts/
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Okay, I found something that actually works for me. But the problem is for some reason when

I test it, I send a message to myself, I never recieve my message at

all. I do not have a clue whatsoever. In addition, I made some tweaks

since if I use contact-form.php which my website is htm made content,

it could only display .htm? Odd, since I could support .php as shown

below. So I use contact-form.htm, even though, I tried

contact-form.php on the seperate windows. It still does not work.

My PHP is 4.3.10

Using CPanel X 10 Stable

Furthermore, I was wondering what do you mean by "* Mail() module

supported. (This module is rarely not supported)." Where to get a mail

module? I was wondering if I need it.

I hope you could reply to this message!

Thanks a lot!

http://software.xornic.com/contact/

  • 0

Heres one i found on some tutorial site, was half way through tidying it up (fixing the output email etc).

Works fine. Uploaded it on my space so you could check it out. Just remember to change your email on the 5th line.

When the email arrives it looks like this:

  Quote
Name: Lisa

E-Mail: simpson@hotmail.com

Message: Hi, i like to play the saxamaphone.

Click reply and it will send to this email.

So just whack this into a file called form.php or whatever and link/include it :)

<?
if(isset($_POST['sendMail']))
{

$to = "YOUREMAILHERE";
$name = trim($_POST['name']);
$email = trim($_POST['email']);
$message = trim($_POST['message']);

if(((empty($name))||(empty($email))||(empty($message))))
{

echo 'Please fill in all fields. ';
echo '<a href="javascript:history.back(1)">Tryn</a>';

} else {

if(!strstr($email , "@"))
{

echo "The E-Mail address, $email, does not appear to be valid. ";
echo '&lt;a href="javascript:history.back(1)">Back</a>} else {

$send = mail($to , "Message from $name" , "Name: ".$name. "\nE-Mail: ".$email."\nMessage: ".$message."\n\nClick reply and it will send to this email." , "From:".$email);

if($send)
{

echo "Thankyou $name, we will be sure to contact you shortly.";

} else {

echo 'There was an error sending the mail.';

}
}
}
 } else {

echo '

&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;Name:&lt;/td&gt;
&lt;td&gt;&lt;form name="contact" method="post" action="'.$_SERVER["PHP_SELF"].'"&gt;&lt;input name="name" type="text" size="32"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Email:&lt;/td&gt;
&lt;td&gt;&lt;input name="email" type="text" size="32"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Message:&lt;/td&gt;
&lt;td&gt;&lt;textarea name="message" cols="50" rows="6"&gt;&lt;/textarea&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;input type="submit" name="sendMail" value="Submit"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/form&gt;
&lt;/table&gt;

';

}
?&gt;

Hope this works :)

Edited by fmxer
  • 0

So, its pure .php? No need for .htm? Thank you, I don't think it acutally recieved my message to my recepeant - spywareguide@gmail.com. Im sorry, Im quite new to .php so, thank you for your patients, but is that correct? If I am missing any code, please inform me, thanks. I am also curious if have to put the <html> coding as well in the body of the page or just pure copy and paste of the code that you posted?

&lt;?
if(isset($_POST['sendMail']))
{

$to = "spywareguide@gmail.com";
$name = trim($_POST['name']);
$email = trim($_POST['email']);
$message = trim($_POST['message']);

if(((empty($name))||(empty($email))||(empty($message))))
{

echo 'Please fill in all fields. ';
echo '&lt;a href="javascript:history.back(1)">Tryn&lt;/a&gt;';

} else {

if(!strstr($email , "@"))
{

echo "The E-Mail address, $email, does not appear to be valid. ";
echo '&lt;a href="javascript:history.back(1)">Back</a>} else {

$send = mail($to , "Message from $name" , "Name: ".$name. "\nE-Mail: ".$email."\nMessage: ".$message."\n\nClick reply and it will send to this email." , "From:".$email);

if($send)
{

echo "Thankyou $name, we will be sure to contact you shortly.";

} else {

echo 'There was an error sending the mail.';

}
}
}
} else {

echo '

&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;Name:&lt;/td&gt;
&lt;td&gt;&lt;form name="contact" method="post" action="'.$_SERVER["PHP_SELF"].'"&gt;&lt;input name="name" type="text" size="32"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Email:&lt;/td&gt;
&lt;td&gt;&lt;input name="email" type="text" size="32"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Message:&lt;/td&gt;
&lt;td&gt;&lt;textarea name="message" cols="50" rows="6"&gt;&lt;/textarea&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;input type="submit" name="sendMail" value="Submit"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/form&gt;
&lt;/table&gt;

';

}
?&gt;

Edited by RCJS
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.