Jump to content

Recommended Posts

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 17
How 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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.