Jump to content

Recommended Posts

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("dev@gwlp.ragenetwork.com", "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

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("dev@gwlp.ragenetwork.com", "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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.