Jump to content

Archived

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

theunavailablename

Email/php form from webpage

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
This may help: http://www.tizag.com/phpT/examples/formex.php

Example of what this tutorial does: http://www.tizag.com/phpT/examples/formexample.php

Share this post


Link to post
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 = "you@yourdomain.com";
  $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

Share this post


Link to post
Share on other sites
What I mean is searching on this forum, if he had search for it here, he could find them.

Share this post


Link to post
Share on other sites

×

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.