gerbs987 Posted July 21, 2007 Share Posted July 21, 2007 Hi. i'm fairly new to PHP, and i've run into a bit of a problem. I am trying to set up a website for myself and friends to use for an NFL pool However, i want to create a selection page where the user may select which teams he/she believes will win and not only put this info into an email to myself(which i've already been able to do), but to also echo their selections back to them after they click the submit button. Is this at all possible? I just want to do this so that the users can double check their picks after submitting, and then that way they can either re-submit, or print off their own choices. Any help is greatly appreciated. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted July 21, 2007 Share Posted July 21, 2007 I don't know how proficent your php is but thats a lot to chew off for a no0bie (i mean that because its your tag on the forum) It will include all of the following and more 1) Mysql Databasing 2) User registration 3) User login 4) mail() function 5) Variable passing via POST and phrasing of them 6) A lot more I can't even think of right now Quote Link to comment Share on other sites More sharing options...
gerbs987 Posted July 21, 2007 Author Share Posted July 21, 2007 it's not meant to have a database, or user registration. last year i ran this pool, and it was simple. the user came to the site, selected what they wanted in the form, put in their screen name, and hit submit which would send their choices to me in an email. all i'm looking to do now is change the form from check boxes, to radio buttons(or keep it as check boxes if it's easier) and when they click submit, still have the email sent to me, but also just display the choices back to them. hopefully that helps. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted July 21, 2007 Share Posted July 21, 2007 not really a php question, but i guess this is so small you can run it all manually, otherwise i say data base it if you are using php already to email yourself the choices, then simply use the variables in the email in echo statements Quote Link to comment Share on other sites More sharing options...
gerbs987 Posted July 21, 2007 Author Share Posted July 21, 2007 ok. well i just don't really know where to start. i have the existing page that i used last year, but i just wanted to maybe use variables in the form, that i could echo later, but that's where i'm unsure, and don't know where to start. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted July 21, 2007 Share Posted July 21, 2007 show us this code, if you know how to do email in php i don't see how echo statements are so difficult for you. Quote Link to comment Share on other sites More sharing options...
gerbs987 Posted July 21, 2007 Author Share Posted July 21, 2007 ok. here's the code for the index page that i use. and i had help on building this from a friend. i was able to do some of it, but was unable to do the email function on my own. <?php function show_form() { ?> <center><body><h2><img src="nfl.jpg"><b><font face="arial">Winnipegfootballpool.com</b></font></h2> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <b><u><a href="info.html"><font face="arial">RULES & INFO</font></a></b></u><br> <b><u><font face="arial"><a href="standings.html">POOL STANDINGS</a></font></u></b><br> <b><u><font face="arial"><a href="table.html">SPREADSHEET</a></font></b></u> <p><b><u><font face="arial">THURSDAY SEPT. 07/2006 7:30PM</font></u></b></p> <font face="comic sans ms"><input name="1" type="checkbox" value="Miami Dolphins">MIAMI DOLPHINS @ PITTSBURGH STEELERS<input name="2" type="checkbox" value="Pittsburgh Steelers"><br></font><p> <b><u><font face="arial">SUNDAY SEPT. 10/2006 12:00PM</font></u></b></p> <font face="comic sans ms"><input name="3" type="checkbox" value="Atlanta Falcons">ATLANTA FALCONS @ CAROLINA PANTHERS<input name="4" type="checkbox" value="Carolina Panthers"><br> <input name="5" type="checkbox" value="Baltimore Ravens">BALTIMORE RAVENS @ TAMPA BAY BUCCANEERS<input name="6" type="checkbox" value="Tampa Bay Buccaneers"><br> <input name="7" type="checkbox" value="Buffalo Bills">BUFFALO BILLS @ NEW ENGLAND PATRIOTS<input name="8" type="checkbox" value="New England Patriots"><br> <input name="9" type="checkbox" value="Cincinnati Bengals">CINCINNATI BENGALS @ KANSAS CITY CHIEFS<input name="10" type="checkbox" value="Kansas City Chiefs"><br> <input name="11" type="checkbox" value="Denver Broncos">DENVER BRONCOS @ ST. LOUIS RAMS<input name="12" type="checkbox" value="St. Louis Rams"><br> <input name="15" type="checkbox" value="New Orleans Saints">NEW ORLEANS SAINTS @ CLEVELAND BROWNS<input name="16" type="checkbox" value="Cleveland Browns"><br> <input name="17" type="checkbox" value="New York Jets">N.Y. JETS @ TENNESSEE TITANS<input name="18" type="checkbox" value="Tennessee Titans"><br> <input name="19" type="checkbox" value="Philadelphia Eagles">PHILADELPHIA EAGLES @ HOUSTON TEXANS<input name="20" type="checkbox" value="Houston Texans"><br> <input name="21" type="checkbox" value="Seattle Seahawks">SEATTLE SEAHAWKS @ DETROIT LIONS<input name="22" type="checkbox" value="Detroit Lions"><br><p></font> <p><u><b><font face="arial">3:15PM GAMES</font></u></b></p> <font face="comic sans ms"><input name="23" type="checkbox" value="Chicago Bears">CHICAGO BEARS @ GREEN BAY PACKERS<input name="24" type="checkbox" value="Green Bay Packers"><br> <input name="25" type="checkbox" value="Dallas Cowboys">DALLAS COWBOYS @ JACKSONVILLE JAGUARS<input name="26" type="checkbox" value="Jacksonville Jaguars"><br> <input name="27" type="checkbox" value="San Francisco 49ers">SAN FRANCISCO 49ERS @ ARIZONA CARDINALS<input name="28" type="checkbox" value="Arizona Cardinals"><br></font> <p><u><b><font face="arial">7:15PM GAME</font></b></u></p> <font face="comic sans ms"><input name="29" type="checkbox" value="Indianapolis Colts">INDIANAPOLIS COLTS @ N.Y. GIANTS<input name="30" type="checkbox" value="New York Giants"><br></font> <p><u><b><font face="arial">MONDAY SEPT. 11/2006 6:00PM</font></b></u></p> <font face="comic sans ms"><input name="13" type="checkbox" value="Minnesota Vikings">MINNESOTA VIKINGS @ WASHINGTON REDSKINS<input name="14" type="checkbox" value="Washington Redskins"><br> <p><u><b><font face="arial">MONDAY SEPT. 11/2006 9:15PM</font></b></u></p> <input name="31" type="checkbox" value="San Diego Chargers">SAN DIEGO CHARGERS @ OAKLAND RAIDERS<input name="32" type="checkbox" value="Oakland Raiders"><br></font> <p><b><font face="arial">TOTAL POINTS SCORED ON MNF:<input type="text" name="33" maxlength="3" size="3"><a href="what.html">What's This?</b></font></a> <p><font face="arial"><b>NAME:<input type="text" name="name" maxlength="16"></b></font><br> <input type="submit" value="Submit This Week's Picks!"><input type="reset" value="Clear Form"></p> </form> </body> </center> </html> <? } if(!isset($_POST['name'])){ show_form(); exit; } foreach($_POST as $key => $value){ $loler[$key] = $value; } if(sizeof($array) > 3){ echo "only select 1 please"; show_form(); exit; } $to = "bryan.treller@shaw.ca"; $subject = $_POST['name']; foreach($loler as $key => $value){ $string .= $value."\n"; } $headers = "From:bryant@winnipegfootballpool.com"; mail($to, $subject, $string, $headers); echo '<h2><b><font face="arial">Thanks for submitting your picks!</font></b></h2>'; ?> Quote Link to comment Share on other sites More sharing options...
gerbs987 Posted July 21, 2007 Author Share Posted July 21, 2007 is anyone able to help me with this? Quote Link to comment Share on other sites More sharing options...
markjoe Posted July 21, 2007 Share Posted July 21, 2007 After you send the email and echo the message, you can simply echo the same string you just sent in the email. echo $string; add formatting to your liking. Quote Link to comment Share on other sites More sharing options...
gerbs987 Posted July 21, 2007 Author Share Posted July 21, 2007 thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.