silentg0d Posted March 10, 2007 Share Posted March 10, 2007 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>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/42083-solved-is-there-a-way-to-get-to-work-in-this-email/ Share on other sites More sharing options...
per1os Posted March 10, 2007 Share Posted March 10, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/42083-solved-is-there-a-way-to-get-to-work-in-this-email/#findComment-204120 Share on other sites More sharing options...
kenrbnsn Posted March 10, 2007 Share Posted March 10, 2007 You don't need the "{ }" there at all. Leave them out. Ken Quote Link to comment https://forums.phpfreaks.com/topic/42083-solved-is-there-a-way-to-get-to-work-in-this-email/#findComment-204121 Share on other sites More sharing options...
silentg0d Posted March 10, 2007 Author Share Posted March 10, 2007 I do its in a format that can be copy and pasted Edit: Neither of these worked any ideas please this is very important Quote Link to comment https://forums.phpfreaks.com/topic/42083-solved-is-there-a-way-to-get-to-work-in-this-email/#findComment-204396 Share on other sites More sharing options...
per1os Posted March 10, 2007 Share Posted March 10, 2007 I think he just wants it to display in the email text, not to process the variable. If so my code above should work. --FrosT Quote Link to comment https://forums.phpfreaks.com/topic/42083-solved-is-there-a-way-to-get-to-work-in-this-email/#findComment-204398 Share on other sites More sharing options...
gargoylemusic Posted March 10, 2007 Share Posted March 10, 2007 Try escaping the curly braces. "\{$Profession\}" Quote Link to comment https://forums.phpfreaks.com/topic/42083-solved-is-there-a-way-to-get-to-work-in-this-email/#findComment-204430 Share on other sites More sharing options...
silentg0d Posted March 11, 2007 Author Share Posted March 11, 2007 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>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/42083-solved-is-there-a-way-to-get-to-work-in-this-email/#findComment-204607 Share on other sites More sharing options...
per1os Posted March 11, 2007 Share Posted March 11, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/42083-solved-is-there-a-way-to-get-to-work-in-this-email/#findComment-204614 Share on other sites More sharing options...
silentg0d Posted March 11, 2007 Author Share Posted March 11, 2007 I've got outside help, solved Quote Link to comment https://forums.phpfreaks.com/topic/42083-solved-is-there-a-way-to-get-to-work-in-this-email/#findComment-204914 Share on other sites More sharing options...
kenrbnsn Posted March 11, 2007 Share Posted March 11, 2007 What was the solution? Ken Quote Link to comment https://forums.phpfreaks.com/topic/42083-solved-is-there-a-way-to-get-to-work-in-this-email/#findComment-204915 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.