membot Posted October 17, 2011 Share Posted October 17, 2011 I haven't used PHP in a while. I'm getting "unexpected T_ENCAPSED_AND_WHITESPACE" on the second line of this: if(isset($_GET['name'], $_GET['organization'], $_GET['email'], $_GET['message'])){ mail('[email protected]', 'maybearobot: '.$_GET['organization'], "Name: $_GET['name'] /n/n Return Email: $_GET['email'] /n/n $_GET['message']"); } Link to comment https://forums.phpfreaks.com/topic/249274-unexpected-t_encapsed_and_whitespace/ Share on other sites More sharing options...
gizmola Posted October 17, 2011 Share Posted October 17, 2011 When you use an array with single quotes around the key name in an interpolated string you have to put a block around the variable: mail('[email protected]', 'maybearobot: '.$_GET['organization'], "Name: {$_GET['name']} /n/n Return Email: {$_GET['email']} /n/n {$_GET['message']}"); Link to comment https://forums.phpfreaks.com/topic/249274-unexpected-t_encapsed_and_whitespace/#findComment-1280019 Share on other sites More sharing options...
membot Posted October 18, 2011 Author Share Posted October 18, 2011 Oh ok. Thanks. Link to comment https://forums.phpfreaks.com/topic/249274-unexpected-t_encapsed_and_whitespace/#findComment-1280292 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.