Jump to content

Popup chat wont work :(


balkan7

Recommended Posts

where i wrong ?

 

chat.php

<?php
require_once "maincore.php";
require_once BASEDIR."subheader.php";
include LOCALE.LOCALESET."global.php";
require_once BASEDIR."side_left.php";


opentable($locale['1c']);
$java = nl2br($locale['4c']);
   
echo "<form name='login'>
      <table cellSpacing='0' cellPadding='0' width='100%' border='0'>
      <tr>
      <td class='S'><p align='center'>".$java."
      <a target='_blank' href='http://www.java.com/en/download/windows_ie.jsp?begindownload=true'>
         ".$locale['5c']."</a></td>
      </tr>
      </table>
      <br />
      <table cellSpacing='0' cellPadding='0' width='100%' border='0'>
              <tr>
                 <td align='center' class='S'>
                <b><font color='#008080'>
                ".$locale['3c']." </font> </b>
               
             <input name='nick' type='textbox' value size='20' style='font-family: border: 1px solid #008080; float:center'></td>
            </tr>
                           
            <tr>
           <td class='S' align='right' colSpan='2'>
          <p align='center'><br />   
         <input class='button' type='submit' onclick='window.open('chat/chat2.php', 'popup', 'height=500,width=600');' value='".$locale['2c']."' style='float: center'>     
        </td>
       </tr>
      </table>";
closetable();

require_once BASEDIR."side_right.php";
require_once BASEDIR."footer.php";
?>

 

chat/chat2.php

<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 $_POST['nick']; ?>">
   <param name="alternatenick" value="<?php echo $_POST['nick']; ?>??">
   <param name="password" value="">
   <param name="name" value="Labunista Korisnik">
   <param name="host" value="profimax.net">
   <param name="port" value="6667">
   <param name="command1" value="join #Test">
   <param name="gui" value="pixx">
   <param name="quitmessage" value="PJIRC forever!">
   <param name="language" value="english">
   <param name="pixx:language" value="pixx-english">
   <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="soundbeep" value="snd/bell2.au">
   <param name="soundquery" value="snd/ding.au">
   </applet>

Link to comment
Share on other sites

i change code in chat.php to:

<?php
require_once "maincore.php"; 
require_once BASEDIR."subheader.php";
include LOCALE.LOCALESET."global.php"; 
require_once BASEDIR."side_left.php"; 


opentable($locale['1c']);
$java = nl2br($locale['4c']);

echo "<form name='login' method='get' onSubmit='return popupChat();'> 
      <table cellSpacing='0' cellPadding='0' width='100%' border='0'>
      <tr>
      <td class='S'><p align='center'>".$java."
      <a target='_blank' href='http://www.java.com/en/download/windows_ie.jsp?begindownload=true'>
		".$locale['5c']."</a></td>
      </tr>
      </table>
      <br />
      <table cellSpacing='0' cellPadding='0' width='100%' border='0'>
              <tr>
                 <td align='center' class='S'>
                <b><font color='#008080'>
                ".$locale['3c']." </font> </b>
               
             <input name='nick' type='textbox' value size='20' style='font-family: border: 1px solid #008080; float:center'></td>
            </tr>
                           
            <tr>
           <td class='S' align='right' colSpan='2'>
          <p align='center'><br />   
         <input class='button' type='submit' value='".$locale['2c']."' style='float: center'>      
        </td>
       </tr>
      </table>";
  echo "<script type='text/javascript'>
  function popupChat() {
win=window.open('chat/chat2.php', 'WebChat',
'height=420,width=660');
}</script>";
closetable();

require_once BASEDIR."side_right.php"; 
require_once BASEDIR."footer.php"; 
?> 

 

now opened popup but wrong whit value nick, not get typed nick...

Link to comment
Share on other sites

You're not sending the chat anything it can use, the way you're calling the popup, the page cannot pick up posted values.

 

You may want to consider appending the nick to the popup...

 

So your code would change to this:

echo "<form name='login' method='get' onSubmit='return popupChat(document.login.nick.value);'> 

and also this:

echo "<script type='text/javascript'>
  function popupChat(nick) {
win=window.open('chat/chat2.php?nick='+urlencode(nick), 'WebChat',
'height=420,width=660');
}</script>";

 

then I just noticed you'll have to urldecode the php in the applet

<param name="nick" value="<?php echo urldecode($_POST['nick']); ?>">

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.