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("t.r.s.silent@gmail.com",
$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>";
  }
?>

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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("gwlpdev@gmail.com",
  $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>";
  }
?>

Link to comment
Share on other sites

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("gwlpdev@gmail.com",
  $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

Link to comment
Share on other sites

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.