Sythe.Org Forums     Register     FAQ     Members List     Calendar     Mark Forums Read    
 
Sythe.Org Forums  
   Runescape Gold

Sythe.org — A Virtual Goods Trading Hub

Make real cash! buying and selling in-game items.

We have a no-scam policy.

You can make thousands playing your favourite games here at Sythe.org.

Just sign up an account and follow the rules!


Take me to

Runescape Markets

Other Game Markets

Support Center

Register an Account

Close
[PHP] Simple 'contact' form
Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 11-23-2010, 09:02 PM
World Domination's Avatar
Guru
$25 USD Donor
 
Join Date: Apr 2007
Location: Illinois, USA.
Posts: 1,553
Send a message via MSN to World Domination
Default [PHP] Simple 'contact' form

This is a really simple contact form designed to be put on your website so a user can contact you easily.

You'll need to create 2 files; and .html and a .php file named contactform.html and ************, respectively.

Use the following HTML code in your .html file:
Code:
<form method="POST" action="************">
   <p>Your Name:<br>
     <input type="text" name="name" size="19" />
     <br />
     Your Email Address:<br>
     <input type="text" name="email" size="19">
  </p>
   <p>
     <select  size="1"  name="subject" id="subject">
<option>Business</option>
<option>Site Issue</option>
<option>Personal</option>
<option>Other</option>
</select>
     <br />
    <br>
      Message:<br>
       <textarea rows="9" name="message" cols="30"></textarea>
      <br>
      <br>
      <input type="submit" value="Submit" name="submit">
      </p>
</form>
and use the following PHP code in your ************ file:
PHP Code:
<?php

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

//Change "YOUR_EMAIL_ADDRESS" to the email you want the messages ent to.
$to "YOUR_EMAIL_ADDRESS";
$subject $_POST['subject'];
$name_field $_POST['name'];
$email_field $_POST['email'];
$message $_POST['message'];
 
$body "From: $name_field\n E-Mail: $email_field\n Message:\n $message";
 
echo 
"Message sent to $to";
mail($to$subject$body);

} else {

echo 
"Email not sent, try again.";

}
?>
A couple notes:
- be sure to change the Value of the $to variable to your email address you want the script to send the emails to.
- You can add/remove/change the drop down options of the subject by editing the HTML.

Edit:
I forgot to mention, you host must have the "SendMail" function set in the php.ini file, or this won't work.

Edit2:
Errr, the "************" above should be contact [dot] php, I'm not sure why it filtered this.

Last edited by World Domination : 11-23-2010 at 09:05 PM.
Reply With Quote
  #2  
Old 11-23-2010, 09:12 PM
Active Member
BANNED
 
Join Date: Nov 2010
Posts: 165
Default Re: [PHP] Simple 'contact' form

Epic fail with the censors, other than that nice.

Bookmarking this for future reference.
Reply With Quote
Reply



Cheap RS Gold Store  Runescape Gold

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

All times are GMT +1. The time now is 02:07 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.1