Resend my activation email : Register : Log in 
BCF: Bike Chat Forums


HTML and PHP help needed

Reply to topic
Bike Chat Forums Index -> The Geek Zone
View previous topic : View next topic  
Author Message

400bandit
World Chat Champion



Joined: 21 Dec 2005
Karma :

PostPosted: 16:05 - 05 Feb 2011    Post subject: HTML and PHP help needed Reply with quote

Hi All,

I have created a simple HTML form from which I want the information entered to send via email to me. I am no coder but can do bits and bobs. As I understand it I need a PHP script to send the information entered to an email address without the user having to manually send the email (i.e. using the standard HTML <form method="post"; action="mailto:[email protected]";>).

How much work does it take to get use PHP to send me the information entered into the form? I understand that there are many free PHP scripts out there that can be used for free but obviously need modifying. Can anyone recommend one?

Thanks,

Joe
____________________
Current Bikes 650 Honda Bros, VTR1000 Firestorm // Past Bikes: Sachs Madass 50/110cc - Bandit 400 - FZR750
(+ a XS650 in lots of pieces in my garage and other places...)
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

Frost
World Chat Champion



Joined: 26 May 2004
Karma :

PostPosted: 16:50 - 05 Feb 2011    Post subject: Reply with quote

Code:
<html>
<body>

<?php
if (isset($_REQUEST['email']))
//if "email" is filled out, send email
  {
  //send email
  $email = $_REQUEST['email'] ;
  $subject = $_REQUEST['subject'] ;
  $message = $_REQUEST['message'] ;
  mail( "[email protected]", "Subject: $subject",
  $message, "From: $email" );
  echo "Thank you for using our mail form";
  }
else
//if "email" is not filled out, display the form
  {
  echo "<form method='post' action='mailform.php'>
  Email: <input name='email' type='text' /><br />
  Subject: <input name='subject' type='text' /><br />
  Message:<br />
  <textarea name='message' rows='15' cols='40'>
  </textarea><br />
  <input type='submit' />
  </form>";
  }
?>

</body>
</html>


Not tested and shamelessly nicked from w3 schools, but it'll work and do what you want. It's a good starting point to customise things yourself.
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

Ditto
Nearly there...



Joined: 26 Sep 2009
Karma :

PostPosted: 23:32 - 06 Feb 2011    Post subject: Reply with quote

Yup, I used this one recently and it works well.

https://www.freecontactform.com/email_form.php

Basically add that HTML code into your website where you want the form to appear and Open notepad, paste the PHP code and save it as send_form_email.php.

Once online it will work. (Wont work offline!).

Change the email address in the PHP script to your own.

If you want the form to redirect back to your website, add this to the bottom of the PHP script. The red part is the bit to add, the rest is just the reference of where to add it.

------------------------------------------------------

// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);

header ("Location: thanks.html");
}
?>
____________________
CG 125 > Bandit 600 > CBR 600 FY > Street Triple R
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

TUG
World Chat Champion



Joined: 12 May 2007
Karma :

PostPosted: 16:08 - 08 Feb 2011    Post subject: Reply with quote

Ditto what well... Ditto said, i have a form on my site that i generated on the free sights then with help from Recoil removed the advertisements
____________________
Haz ER-5, innit!
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts
Old Thread Alert!

The last post was made 15 years, 241 days ago. Instead of replying here, would creating a new thread be more useful?
  Display posts from previous:   
This page may contain affiliate links, which means we may earn a small commission if a visitor clicks through and makes a purchase. By clicking on an affiliate link, you accept that third-party cookies will be set.

Post new topic   Reply to topic    Bike Chat Forums Index -> The Geek Zone All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Read the Terms of Use! - Powered by phpBB © phpBB Group
 

Debug Mode: ON - Server: birks (www) - Page Generation Time: 0.07 Sec - Server Load: 0.75 - MySQL Queries: 13 - Page Size: 41.4 Kb