deco Posted February 12, 2010 Share Posted February 12, 2010 Hi, I'm creating a chat script.. I'm pretty new to PHP. Basically im using a html file for the index where the user sets their nickname and gender and click to join the chatroom. The script is navigated to chatroom.php. Now i need to fetch the username setting, With html i can use these values <? echo $_POST['nickname'] ?>">But the variables are set as $username The code is taken from a phpbb script but as im not using phpbb i need to reconfigure the $username variable which is originally $username = $userdata[username]; } I've tried $username = <? echo $_POST['nickname'] ?>">But it gives this error Parse error: syntax error, unexpected '<' in /home/deco/public_html/deco/x/chatroom.php on line 17How can i set the variable to perform this function by fetching the nickname in chatroom.php without it returning an error? <? echo $_POST['nickname'] ?> Link to comment https://forums.phpfreaks.com/topic/191905-php-help/ Share on other sites More sharing options...
mikesta707 Posted February 12, 2010 Share Posted February 12, 2010 $username = $_POST['nickname']; ? Link to comment https://forums.phpfreaks.com/topic/191905-php-help/#findComment-1011494 Share on other sites More sharing options...
bbaker Posted February 12, 2010 Share Posted February 12, 2010 $username = $_POST['nickname']; echo $username; Link to comment https://forums.phpfreaks.com/topic/191905-php-help/#findComment-1011496 Share on other sites More sharing options...
deco Posted February 12, 2010 Author Share Posted February 12, 2010 $username = $_POST['nickname']; echo $username; Thanks, its working now Link to comment https://forums.phpfreaks.com/topic/191905-php-help/#findComment-1011497 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.