Jump to content

Email/php form from webpage


theunavailablename

Recommended Posts

Well first ill do my intro here as i am new, so hi everyone. well that was fun

alright onto my topic.

What i am looking for is a form that people can fill out by puting there name there email and then picking about 15 games with radio buttions so it may look something like this

Name (first):
Name (Last):
Email:

Pick who you think will win

O team 1 |vs| Team 2 O
O team 1 |vs| Team 2 O
O team 1 |vs| Team 2 O
O team 1 |vs| Team 2 O
O team 1 |vs| Team 2 O
O team 1 |vs| Team 2 O
O team 1 |vs| Team 2 O
O team 1 |vs| Team 2 O
O team 1 |vs| Team 2 O
O team 1 |vs| Team 2 O
O team 1 |vs| Team 2 O
O team 1 |vs| Team 2 O
O team 1 |vs| Team 2 O
O team 1 |vs| Team 2 O

Monday night tie breaker points:
Enter total score:

Submit | Reset


I have looked here (phpfreaks.com) hotscripts.com and yahoo search but cant seem to find a script.

if anyone can help it would be great

thanks

-S

*edit*

*note* I do NOT have the time to go learn how to do this as i have several other projects i am working on.
Link to comment
https://forums.phpfreaks.com/topic/19521-emailphp-form-from-webpage/
Share on other sites

[quote author=hackerkts link=topic=106674.msg426917#msg426917 date=1157247301]
My suggestion was just search on phpfreaks forums about form, and learn from it.
You got to learn and do it yourself, all the best with it.
[/quote]
he stated above that he's already searched... let's be a little more helpful and at least give him a push in the right direction...

here's a start, and you can fly with it as you choose:
[code]
<?php
if (isset($_POST['submit'])) {
  $to = "[email protected]";
  $from = $_POST['email'];
  $subject = "My Form Submission";
  $message = "Name: $_POST[name]\r\n";
  $message .= "Email: $_POST[email]\r\n";
  $message .= "Game 1: $_POST[game1]\r\n";
  $headers = "From: $_POST[name] <$_POST[email]>\r\nReply-To: $_POST[email]";
  if (!mail($to, $subject, $message, $headers)) {
    $error = "<p class=\"error\">Couldn't send message!</p>\n";
  }
}

echo isset($error) ? $error : '';
?>

<form name="myForm" action="" method="post">
Name: <input type="text" name="name" value="" /><br />
Email: <input type="email" name="email" value="" /><br />
Game 1: <input type="radio" name="game1" value="teamX" />Team X | <input type="radio" name="game1" value="teamY" />Team Y<br />
<input type="submit" name="submit" value="Send It!" />
</form>
[/code]

of course, this is extremely rough. you'd want to run validation on all your fields as well. i'm just giving you an overview, and you can get specifics and spread out your form as you go.

good luck

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.