When a user updates their contact details I save the changes but get an "unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING" error when using the below code.
How can I get the above to work without having to declare the variables like in the below example?PHP Code:$field_str .= "firstname = '$_POST['firstname']', ";
$field_str .= "lastname = '$_POST['lastname']' ";
PHP Code://eg.
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$field_str .= "firstname = '$firstname', ";
$field_str .= "lastname = '$lastname' ";
EDIT: Got it working
PHP Code:$field_str .= "firstname = '$_POST[firstname]', ";
$field_str .= "lastname = '$_POST[lastname]', ";





Reply With Quote