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.
You said you already managed to send email with this data so it should be very easy for you to do. For example after submitting form, you can create script like: mail(...); foreach($_POST as $k => $v) { echo "$k : $v"; } PHP: Now you have data emailed to you, and displayed to user. Hope that helps.
well the problem is more that i had to get help from a friend in order to get the email part of it working. that is what i used last year, but was wanting to change it for this year, and not sure where to start. below is the code i used.......any advice from what i already have, or somewhere i can start? <?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>'; ?> Code (markup):
can anyone help me out? i know it's probably very simple, but i barely have a clue as to what i'm doing. if anyone can point me in the right direction.........the example above didn't help too much thanks to my lack of knowledge.