silentg0d Posted March 10, 2007 Share Posted March 10, 2007 Hey i was wondering how i to email php form results so i looked it up and i have got pretty far but i am stuck my code doesn't seem to work properly. If anyone can check it for errors i would appreciate it. <body> <?php if (isset($_REQUEST['Profession'])) //if "email" is filled out, send email { //send email $Profession = $_POST['Profession']; $SetName = $_POST['SetName']; $HeadPiece = $_POST['HeadPiece']; $ChestPiece = $_POST['ChestPiece']; $ArmPiece = $_POST['ArmPiece']; $LegPiece = $_POST['LegPiece']; $FeetPiece = $_POST['FeetPiece']; mail("[email protected]", "Subject: Armor Set", $message, "$head - $SetName - $HeadPiece - $ChestPiece - $ArmPiece - $LegPiece - $FeetPiece" ); echo "Thank you for using our mail form"; } else //if "email" is not filled out, display the form { echo "<form method='post' action='input.php'> Profession: <input type='text' name='Profession'/><br /> Armor Set Name: <input type='text' name='SetName'/><br /> Armor Set ID(Head Piece): <input type='text' name='HeadPiece'/><br /> Armor Set ID(Chest Piece): <input type='text' name='ChestPiece'/><br /> Armor Set ID(Arm Piece): <input type='text' name='ArmPiece'/><br /> Armor Set ID(Leg Piece): <input type='text' name='LegPiece'/><br /> Armor Set ID(Feet Piece): <input type='text' name='FeetPiece'/><br /> <input type='submit' /> </form>"; } ?> Link to comment https://forums.phpfreaks.com/topic/42070-solved-email-form-results/ Share on other sites More sharing options...
legohead6 Posted March 10, 2007 Share Posted March 10, 2007 remove the action in the html in the <form> tag, it messes with the php. Link to comment https://forums.phpfreaks.com/topic/42070-solved-email-form-results/#findComment-204035 Share on other sites More sharing options...
per1os Posted March 10, 2007 Share Posted March 10, 2007 The action messes with the php? I do not think it does bud. Without the action you cannot tell the script where to go...grant it that this one references the same page. Maybe try this <body> <?php if (isset($_POST'Profession'])) //if "email" is filled out, send email { //send email $Profession = $_POST['Profession']; $SetName = $_POST['SetName']; $HeadPiece = $_POST['HeadPiece']; $ChestPiece = $_POST['ChestPiece']; $ArmPiece = $_POST['ArmPiece']; $LegPiece = $_POST['LegPiece']; $FeetPiece = $_POST['FeetPiece']; mail("[email protected]", "Subject: Armor Set", $message, "$head - $SetName - $HeadPiece - $ChestPiece - $ArmPiece - $LegPiece - $FeetPiece" ); echo "Thank you for using our mail form"; } else //if "email" is not filled out, display the form { echo "<form method='POST' action='input.php'> Profession: <input type='text' name='Profession'/><br /> Armor Set Name: <input type='text' name='SetName'/><br /> Armor Set ID(Head Piece): <input type='text' name='HeadPiece'/><br /> Armor Set ID(Chest Piece): <input type='text' name='ChestPiece'/><br /> Armor Set ID(Arm Piece): <input type='text' name='ArmPiece'/><br /> Armor Set ID(Leg Piece): <input type='text' name='LegPiece'/><br /> Armor Set ID(Feet Piece): <input type='text' name='FeetPiece'/><br /> <input type='submit' /> </form>"; } ?> I do not know why you chose the request for the check in the isset when you reference the $_POST to grab the variables. --FrosT Link to comment https://forums.phpfreaks.com/topic/42070-solved-email-form-results/#findComment-204082 Share on other sites More sharing options...
silentg0d Posted March 10, 2007 Author Share Posted March 10, 2007 This was originally from a different script i just forgot to change it >.< Link to comment https://forums.phpfreaks.com/topic/42070-solved-email-form-results/#findComment-204090 Share on other sites More sharing options...
silentg0d Posted March 10, 2007 Author Share Posted March 10, 2007 Thanks i figured it out [solved] Link to comment https://forums.phpfreaks.com/topic/42070-solved-email-form-results/#findComment-204114 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.