проблем с if

Dido_net

Registered
имам една форма в която попълвам информация



<form action="chat.php" method="post">
Nick : <input type="text" name="nick"><br />
Алтернативен ник : <input type="text" name="nick1"><br />
Server : <select name="srv">
<option value="1">irc.bourgas.net</option>
<option value="2">irc.data.bg</option>
<option value="3" selected="selected">irc.omega.bg</option>
<option value="4">irc.itdnet.net</option>
<option value="5">irc.lirex.com</option>
<option value="6">irc.ma3x.org</option>
<option value="7">irc.spnet.net</option>
<option value="8">irc.varnabg.net</option>
<option value="9">irc.unibg.org</option>
</select>

<br />
<input type="submit" value="Скачай в чата !">
</form>

и следващия файл, чрез който препращам към чата

<?php
$nick = $_POST['nick'];
$nick1=$_POST['nick1'];
$server=$_POST['srv'];
echo $server;
if($nick==NULL || $nick1==NULL || $server==NULL) {echo"<center>Моля попълнете всички полета !</center>";exit;}

if($server="1") {$serv = "irc.bourgas.net";} else
if($server="2") {$serv = "irc.data.bg";} else
if($server="3") {$serv = "irc.omega.bg";} else
if($server="4") {$serv = "irc.itdnet.net";} else
if($server="5") {$serv = "irc.lirex.com";} else
if($server="6") {$serv = "irc.ma3x.org";} else
if($server="7") {$serv = "irc.spnet.net";} else
if($server="8") {$serv = "irc.varnabg.net";} else
if($server="9") {$serv = "irc.unibg.org";}

?>

и.. защо винаги $serv ми е равно на 1 ??? :shock:
 

vesku

Registered
я виж така
Код:
<?php
$nick = $_POST['nick'];
$nick1=$_POST['nick1'];
$server=$_POST['srv'];
echo $server;
if($nick==NULL || $nick1==NULL || $server==NULL) {echo"<center>Моля попълнете всички полета !</center>";exit;}

if($server="1") {$serv = "irc.bourgas.net";}
if($server="2") {$serv = "irc.data.bg";} 
if($server="3") {$serv = "irc.omega.bg";} 
if($server="4") {$serv = "irc.itdnet.net";} 
if($server="5") {$serv = "irc.lirex.com";} 
if($server="6") {$serv = "irc.ma3x.org";} 
if($server="7") {$serv = "irc.spnet.net";} 
if($server="8") {$serv = "irc.varnabg.net";} 
if($server="9") {$serv = "irc.unibg.org";}

?>
 

Dido_net

Registered
vesku каза:
я дай пълния код

form.php

<form action="chat.php" method="post">
Nick : <input type="text" name="nick"><br />
Алтернативен ник : <input type="text" name="nick1"><br />
Server : <select name="srv">
<option value="1">irc.bourgas.net</option>
<option value="2">irc.data.bg</option>
<option value="3" selected="selected">irc.omega.bg</option>
<option value="4">irc.itdnet.net</option>
<option value="5">irc.lirex.com</option>
<option value="6">irc.ma3x.org</option>
<option value="7">irc.spnet.net</option>
<option value="8">irc.varnabg.net</option>
<option value="9">irc.unibg.org</option>
</select>

<br />
<input type="submit" value="Скачай в чата !">
</form>


chat.php

<?php
$nick = $_POST['nick'];
$nick1=$_POST['nick1'];
$server=$_POST['srv'];

if($nick==NULL || $nick1==NULL || $server==NULL) {echo"<center>Моля попълнете всички полета !</center>";exit;}

if($server="1") {$serv = "irc.bourgas.net";}
if($server="2") {$serv = "irc.data.bg";}
if($server="3") {$serv = "irc.omega.bg";}
if($server="4") {$serv = "irc.itdnet.net";}
if($server="5") {$serv = "irc.lirex.com";}
if($server="6") {$serv = "irc.ma3x.org";}
if($server="7") {$serv = "irc.spnet.net";}
if($server="8") {$serv = "irc.varnabg.net";}
if($server="9") {$serv = "irc.unibg.org";}
echo $server;
?>



<applet code="IRCApplet.class" archive="irc.jar,pixx.jar" width="640" height="400">
<param name="CABINETS" value="irc.cab,securedirc.cab,pixx.cab">

<param name="nick" value="<?php echo $nick; ?>">
<param name="alternatenick" value="<?php echo $nick1; ?>">
<param name="name" value="online">
<param name="host" value="<?php echo $serv; ?>">
<param name="command1" value="join #7a.trepach.com">
<param name="gui" value="pixx">
<param name="language" value="bulgarian" />
<param name="pixx:language" value="pixx-bulgarian" />
<param name="pixx:color0" value="47b3ff">
<param name="pixx:color1" value="ffffff">
<param name="pixx:color2" value="ffffff">
<param name="pixx:color3" value="ffffff">
<param name="pixx:color4" value="ffffff">
<param name="pixx:color5" value="a8cfff">
<param name="pixx:color6" value="c3ddff">
<param name="pixx:color7" value="47b3ff">
<param name="pixx:color9" value="47b3ff">

<param name="pixx:showabout" value="false">
<param name="pixx:showhelp" value="false">

<param name="quitmessage" value="http://7a.trepach.com/">
<param name="asl" value="true">
<param name="useinfo" value="true">


<param name="style:backgroundimage" value="true">
<param name="style:backgroundimage1" value="all all 0 bg.gif">
<param name="style:sourcefontrule1" value="all all Tahoma 11">
<param name="style:floatingasl" value="true">

<param name="pixx:timestamp" value="true">
<param name="pixx:highlight" value="true">
<param name="pixx:highlightnick" value="true">
<param name="pixx:nickfield" value="true">
<param name="pixx:styleselector" value="true">
<param name="pixx:showclose" value="false">
<param name="pixx:automaticqueries" value="true">
<param name="pixx:showdock" value="false">

</applet>
:roll:
 

vesku

Registered
<?php
$nick = $_POST['nick'];
$nick1=$_POST['nick1'];
$server=$_POST['srv'];
echo "$server";
if($nick==NULL || $nick1==NULL || $server==NULL) {echo"<center>Моля попълнете всички полета !</center>";exit;}

if($server="1") {$serv = "irc.bourgas.net";}
if($server="2") {$serv = "irc.data.bg";}
if($server="3") {$serv = "irc.omega.bg";}
if($server="4") {$serv = "irc.itdnet.net";}
if($server="5") {$serv = "irc.lirex.com";}
if($server="6") {$serv = "irc.ma3x.org";}
if($server="7") {$serv = "irc.spnet.net";}
if($server="8") {$serv = "irc.varnabg.net";}
if($server="9") {$serv = "irc.unibg.org";}

?>
 

bafitu

Registered
Код:
<?php
$nick = $_POST['nick'];
$nick1=$_POST['nick1'];
$server=$_POST['srv'];

if($nick==NULL || $nick1==NULL || $server==NULL) {echo"<center>Моля попълнете всички полета !</center>";exit;}

if($server== "1") {$serv = "irc.bourgas.net";}
if($server=="2") {$serv = "irc.data.bg";}
if($server=="3") {$serv = "irc.omega.bg";}
if($server=="4") {$serv = "irc.itdnet.net";}
if($server=="5") {$serv = "irc.lirex.com";}
if($server=="6") {$serv = "irc.ma3x.org";}
if($server=="7") {$serv = "irc.spnet.net";}
if($server=="8") {$serv = "irc.varnabg.net";}
if($server=="9") {$serv = "irc.unibg.org";}
echo $serv.' '.$server;
?>
:roll:
 

Dido_net

Registered
още един проблем.. към същия скрипт... :x
как да накарам да зарежда аплета примерно от папка chat??
с chat/neshto.class не става.. също и с http://url.com/chat/neshto.class не става и с /chat/neshto.class

просто не тръгва.. :shock:
 

Dido_net

Registered
mute каза:
btw ползвай switch
Каква ще е разликата? :shock:
и има ли начин тук

<applet code="include/chat/IRCApplet.class" archive="include/chat/irc.jar,include/chat/pixx.jar" width="640" height="400">
<param name="CABINETS" value="include/chat/irc.cab,include/chat/securedirc.cab,include/chat/pixx.cab">

да ми зарежда аплетите и другите jar и cab файлове от /include/chat/ ?? :roll:
 

Dido_net

Registered
paneznam каза:
ми пробвах с подобно нещо и нестана :) ама пробвай все пак! :lol:
наложи се да сложа файловете в главната папка, за да ги зарежда правилно.. ако някой някъде намери някакъв вариант - да пише :roll:
 

Горе