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
https://forums.phpfreaks.com/topic/92464-popup-chat-wont-work/
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
https://forums.phpfreaks.com/topic/92464-popup-chat-wont-work/#findComment-473762
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
https://forums.phpfreaks.com/topic/92464-popup-chat-wont-work/#findComment-473781
Share on other sites

sorry, crossed languages... use escape() in the javascript, not urlencode()

 

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

Link to comment
https://forums.phpfreaks.com/topic/92464-popup-chat-wont-work/#findComment-473844
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.