Jump to content

[SOLVED] Is there a way to get { to work in this email?


silentg0d

Recommended Posts

I am trying to get { to work in a text field in a email it doesn't seem to show up i need this to work any suggestions? heres my source.

 

Its the { Around Profession on Line 18

<html>
<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]",
$message, "{$Profession} \nSet Name=$SetName; \nHead Piece=$HeadPiece; \nChest Piece=$ChestPiece; \nArm Piece=$ArmPiece; \nLeg Piece=$LegPiece; \nFeet Piece=$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>";
  }
?>

The reason being is that the { } in quotes like you have it just displays that string. Try this:

 

$message, "{".$Profession."} \nSet Name=$SetName; \nHead Piece=$HeadPiece; \nChest Piece=$ChestPiece; \nArm Piece=$ArmPiece; \nLeg Piece=$LegPiece; \nFeet Piece=$FeetPiece;" );

or

$message, "\{".$Profession."} \nSet Name=$SetName; \nHead Piece=$HeadPiece; \nChest Piece=$ChestPiece; \nArm Piece=$ArmPiece; \nLeg Piece=$LegPiece; \nFeet Piece=$FeetPiece;" );

 

I am not sure if the first bracket needs slashed out or not.

 

--FrosT

None of this has worked, any other ideas? i could give you the full code so you could test it for yourself, it will email it just change the email to what you want it to send to.

 

 

 

<html>
<head>
<title>GWLP - Emulation Dev</title>
</head>
<body>
<br>
<br>
<br>
<br>
<br>
<?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]",
  $message, "\{$Profession\} \n$SetName \nHead=$HeadPiece; \nChest=$ChestPiece; \nArm=$ArmPiece; \nLeg=$LegPiece; \nFeet=$FeetPiece;" );
  echo "Thank you for submitting your Armor Set, GWLP Appreciate's your Support";
  }
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>";
  }
?>

None of this has worked, any other ideas? i could give you the full code so you could test it for yourself, it will email it just change the email to what you want it to send to.

 

 

 

<html>
<head>
<title>GWLP - Emulation Dev</title>
</head>
<body>
<br>
<br>
<br>
<br>
<br>
<?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]",
  $message, "\{$Profession\} \n$SetName \nHead=$HeadPiece; \nChest=$ChestPiece; \nArm=$ArmPiece; \nLeg=$LegPiece; \nFeet=$FeetPiece;" );
  echo "Thank you for submitting your Armor Set, GWLP Appreciate's your Support";
  }
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>";
  }
?>

 

Change the \n to be \r\n if those are headers they need to be split by \r\n not just \n.

 

--FrosT

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.