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']"); } Quote 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']}"); Quote 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. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.