Jump to content


Photo

Email/php form from webpage


  • Please log in to reply
4 replies to this topic

#1 theunavailablename

theunavailablename
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 02 September 2006 - 10:34 PM

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.

#2 hackerkts

hackerkts
  • Members
  • PipPipPip
  • Advanced Member
  • 593 posts
  • LocationSingapore
  • Age:18

Posted 03 September 2006 - 01:35 AM

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.

Regards,
hackerkts

To be a coder, you must learn how to think and not to give up so easily.


#3 eRott

eRott
  • Members
  • PipPipPip
  • Advanced Member
  • 206 posts
  • LocationToronto, ON

Posted 03 September 2006 - 01:45 AM

This may help: http://www.tizag.com...ples/formex.php

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

#4 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 03 September 2006 - 01:46 AM

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.

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:
<?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>

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
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#5 hackerkts

hackerkts
  • Members
  • PipPipPip
  • Advanced Member
  • 593 posts
  • LocationSingapore
  • Age:18

Posted 03 September 2006 - 01:49 AM

What I mean is searching on this forum, if he had search for it here, he could find them.

Regards,
hackerkts

To be a coder, you must learn how to think and not to give up so easily.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users