Adblock breaks this site

PHP if & else statements

Discussion in 'Web Programming' started by Zenocyde, Feb 5, 2008.

  1. Zenocyde

    Zenocyde Guest

    Referrals:
    0
    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
     
  2. Zenocyde

    Zenocyde Guest

    Referrals:
    0
    PHP if & else statements

    nvm ive solved it now :)
     
  3. SidStudios

    SidStudios Active Member

    Joined:
    Mar 14, 2007
    Posts:
    201
    Referrals:
    0
    Sythe Gold:
    0
    PHP if & else statements

    You should really consider posting how you fixed it, since others would benefit from it.
     
< Very basic Pascal | Curious of what code language binder's are coded in. >


 
 
Adblock breaks this site