Change Room

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Change Room

    How to code chnage room using drop down menu for lavalair?

    #2
    Originally posted by cipap View Post
    How to code chnage room using drop down menu for lavalair?
    PHP Code:
    <?
    <select>
    <option>Select Room</option>
    <option onpick= "chat.php?sid=ur_s_id&rid=1">Room 1</option>
    <option onpick= "chat.php?sid=ur_s_id&rid=2">Room 2</option>
    <option onpick= "chat.php?sid=ur_s_id&rid=3">Room 3</option>
    <option onpick= "chat.php?sid=ur_s_id&rid=4">Room 4</option>
    <option onpick= "chat.php?sid=ur_s_id&rid=5">Room 5</option>
    <option onpick= "chat.php?sid=ur_s_id&rid=6">Room 6</option>
    </select>
    ?>

    Comment


      #3
      can i get the code for html??i have try to use this code but fail

      $rid = mysql_fetch_array(mysql_query("SELECT id FROM ibwf_rooms WHERE id='".$who."'"));
      echo "<form action=\"chat.php?&amp;sid=$sid&amp;rid=$rid\" method=\"post\">";
      echo "Change Room: <select name=\"rid\" value=\"$rid[0]\">";
      if($rid[0]=="1"){$selected=" selected=\"selected\"";}else{$selected="";}
      echo "<option value=\"1\"$selected>room1</option>";
      if($rid[0]=="2"){$selected=" selected=\"selected\"";}else{$selected="";}
      echo "<option value=\"2\"$selected>room2</option>";
      if($rid[0]=="3"){$selected=" selected=\"selected\"";}else{$selected="";}
      echo "<option value=\"3\"$selected>room3</option>";
      if($rid[0]=="4"){$selected=" selected=\"selected\"";}else{$selected="";}
      echo "<option value=\"4\"$selected>room4</option>";
      echo "</select><br/>";
      echo "<input type=\"Submit\" Name=\"Submit\" Value=\"Change\"></form>

      i think the wrong part is at WHERE id='".$who."'"));
      anybody can help me?

      Comment


        #4
        Originally posted by cipap View Post
        can i get the code for html??i have try to use this code but fail

        $rid = mysql_fetch_array(mysql_query("SELECT id FROM ibwf_rooms WHERE id='".$who."'"));
        echo "<form action=\"chat.php?&amp;sid=$sid&amp;rid=$rid\" method=\"post\">";
        echo "Change Room: <select name=\"rid\" value=\"$rid[0]\">";
        if($rid[0]=="1"){$selected=" selected=\"selected\"";}else{$selected="";}
        echo "<option value=\"1\"$selected>room1</option>";
        if($rid[0]=="2"){$selected=" selected=\"selected\"";}else{$selected="";}
        echo "<option value=\"2\"$selected>room2</option>";
        if($rid[0]=="3"){$selected=" selected=\"selected\"";}else{$selected="";}
        echo "<option value=\"3\"$selected>room3</option>";
        if($rid[0]=="4"){$selected=" selected=\"selected\"";}else{$selected="";}
        echo "<option value=\"4\"$selected>room4</option>";
        echo "</select><br/>";
        echo "<input type=\"Submit\" Name=\"Submit\" Value=\"Change\"></form>

        i think the wrong part is at WHERE id='".$who."'"));
        anybody can help me?

        PHP Code:
        $rooms mysql_query("SELECT id, name, perms, mage, chposts FROM ibwf_rooms WHERE static='1' AND clubid='0'");
        while (
        $roommysql_fetch_array($rooms))
                {
                  
                  if(
        canenter($room[0], $sid))
                  {
                    
        $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE rid='".$room[0]."'"));
             
         echo 
        "<option value=\"$room[0]\">$room[1]($noi[0])</option>";       

        //its not the full cod u can use that for ur code:)

              
        }
                
              } 
        maybe that can help u
        Last edited by i0nutzxp; 30.06.09, 14:48.
        <?php unlink('World/Europe/Romania.country'); ?>

        Comment


          #5
          it not working..

          Comment


            #6
            how to change this into html??

            echo"change room";
            $rss = mysql_query("SELECT name, id FROM ibwf_rooms");
            echo "<br/><select name=\"chrid\">";
            while($rs=mysql_fetch_array($rss))
            {
            echo "<option value=\"$rs[1]\">$rs[0]</option>";
            }
            echo "</select><br/>";
            echo "<br/><anchor>Go<go href=\"chat.php\" method=\"get\">";
            echo "<postfield name=\"rid\" value=\"$(chrid)\"/>";
            echo "<postfield name=\"sid\" value=\"$sid\"/>";
            echo "</go></anchor>";

            Comment

            Working...
            X