Change Room

Started on the old forum in June 2009 · view the original in the archive · old links redirect here

5 replies · 654 views · started 17 years ago · 1 min read

2 participants
cipap Newbie · 7 posts #1

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

Guest #2

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

<?
<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>
?>
cipap Newbie · 7 posts #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?&sid=$sid&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> "; echo "<input type="Submit" Name="Submit" Value="Change"></form>

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

i0nutzxp Developer · 150 posts #4

cipap wrote: 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?&sid=$sid&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> "; echo "<input type="Submit" Name="Submit" Value="Change"></form>

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

$rooms = mysql_query("SELECT id, name, perms, mage, chposts FROM ibwf_rooms WHERE static='1' AND clubid='0'");
while ($room= mysql_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 🙂 😌

<?php unlink('World/Europe/Romania.country'); ?>
cipap Newbie · 7 posts #5

it not working..

cipap Newbie · 7 posts #6

how to change this into html??

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

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close