Reputation: 161
Here is the portion of my PHP code that I'm trying to work with:
$usersname = $_POST["usersname"];
$usersemail = $_POST["usersemail"];
$usersphone = $_POST["usersphone"];
$mailsubject = "New Customer Quote - Form Submission";
$usersbusiness = $_POST["usersbusiness"];
$userswebsite = $_POST["userswebsite"];
$usersbudget = $_POST["usersbudget"];
$usersmessage = $_POST["usersmessage"];
This is specifically what I am trying to change:
$mailsubject = "New Customer Quote - Form Submission";
I would like to change "Form Submission" to whatever the customer entered as their budget. Here is that I tried doing but apparently doesn't working:
$mailsubject = "New Customer Quote - $_POST["usersbudget"]";
I know this is something that's probably extremely simple, I just can't seem to figure out what's happening with it...
Upvotes: 0
Views: 43
Reputation: 1605
As an alternative to concatenation suggested by the other answers, you can use curly braces:
$mailsubject = "New Customer Quote - {$_POST['usersbudget']}";
Make sure you replace the double quotes with single quotes though; you can't have double quotes inside double quotes the way you have it in your question.
Upvotes: 0
Reputation: 2249
Its Simple...
Please use
$mailsubject = "New Customer Quote - ". $_POST["usersbudget"];
instead
Upvotes: 0
Reputation: 1897
You should use a "." for string concatenation as
$mailsubject = "New Customer Quote - " . $_POST["usersbudget"];
Upvotes: 0
Reputation: 44844
$mailsubject = "New Customer Quote - $_POST["usersbudget"]";
should be
$mailsubject = "New Customer Quote - ".$_POST["usersbudget"];
You need to concatenate.
Upvotes: 2