• Log in or sign up for an account here: https://www.sythe.org/login

PHP if & else statements

  • Thread starter Thread starter Zenocyde
  • Start date Start date
Z

Zenocyde

Guest
PHP if & else statements
Are there any php coders out there that can help me with this? I am working on a chat network and i am trying to setup one of the parameters. On my chat network i have a list of official rooms that can be selected from a drop down box, or you can type in the name of a created chat room in to another field. On submitting this it forwards you to the chatrooom.php file and joins the appropriate room. This is my code

<PARAM name="Room" value="<? if (isset($_POST['created_room'])) <? echo $_POST['created_room'] ?>">

I need to add an else statement onto the end so that if someone just left the created_field blank it just looks at the official room list. Ive tried this code

<PARAM name="Room" value="<? if (isset($_POST['created_room'])) { echo $_POST['created_room']; } else { echo "$_POST['official_room']; } ?>"

but it doesnt seem to work. any ideas?

idk if you can make any sense of this post lol
 
PHP if & else statements
Runescape Gamblingrunescape gambling
Back
Top