473,748 Members | 10,048 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

php/mysql variable passing in Javascript

I have a phpnuke website, and I use DigiChat chat. Since I have users who
register, I'd like to be able to pass there username and email (at a
minimum) into the chat system, so they do not have to enter in their
information multiple times.

I am attempting to use the below file (which was obtained from a website
using DigiChat and something called IBForums), but I am not able to get any
output on the page when using it. Any help?

Thanks
Eric

<?php

//--------------------------------
// Basic DigiChat Integration v1.0 hack by InvisionHacks(t m)
// Copyright 2004 Chris Griego [cgriego]
// http://www.invisionhacks.com/

//class module extends module_loader
{
// var $output = "";

function module()
{
global $fg_phpnuke,
$print,
$std;

$ibforums->lang['digichat_guest '] = "You must register with
our forums to use our chat feature.";

if (!$fg_phpnuke->nuke_users['user_id'])
{
// If a guest, error.
$std->Error(array('L EVEL' => 1, 'MSG' =>
'digichat_guest '));
} else {
$this->output = <<<EOF

<head>
<title>Chat Entry</title>
</head>
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red"
leftmargin="0" marginwidth="0" topmargin="0" marginheight="0 ">
<div align="left">
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%" height="100%">
<tr>
<td align="center" valign="top" width="100%" background="blo ck.title.png"
height="20">&nb sp;</td>
</tr>
<tr>
<TD HEIGHT="100%" ALIGN="left" VALIGN="top" style="margin:0 ;
padding-top:0pt; padding-right:0pt; padding-bottom:0pt; padding-left:10pt;">
<p align="left"><f ont face="Verdana"> Be patient while
chat<br>loads.</font></p>
<p align="left">&n bsp;</p>
</td>
</tr>
</table>
</div>
</body>
</html>

<script language="JavaS cript" type="text/javascript">

isMac = (navigator.appV ersion.indexOf( "Mac")!=-1) ?
true : false;
IEmac = ((document.all) &&(isMac)) ? true : false;
IEwin =
((document.all) &&(navigator.ap pVersion.indexO f("MSIE")!=-1) && !isMac) ?
true : false;
NS = (navigator.appN ame.indexOf("Ne tscape")!=-1) ?
true : false;

document.writel n("<APPLET NAME='DigiChat'
CODEBASE='http://www.flyguylive. com/DigiChat/DigiClasses/' ");

document.writel n("CODE='com.di ginet.digichat. client.DigiChat Applet' ");
if (isMac)
document.writel n("ARCHIVE=Clie nt_Mac.jar
MAYSCRIPT>");
else if (!isMac)
{
if (IEwin)
{

document.writel n("ARCHIVE=Clie nt_Plugin.jar MAYSCRIPT>");
document.write( " <PARAM NAME=cabbase
value=Client_IE .cab>");
document.write( " <PARAM
NAME=useslibrar y value=DigiChat Applet>");
document.write( " <PARAM
NAME=namespace value=Digi-Net>");
document.write( " <PARAM
NAME=useslibrar ycodebase value=Client_IE .cab>");
document.write( " <PARAM
NAME=useslibrar yversion value=4,0,1,0>" );
}
else if (NS)

document.writel n("ARCHIVE='Cli ent_NS.jar' MAYSCRIPT>");
}

document.write( " <PARAM NAME=MenuItem1
VALUE=GrownUpsM eet.com>");
document.write( " <PARAM NAME=MenuLocati on1
VALUE=http://www.GrownUpsMee t.com>");
document.write( " <PARAM NAME=MenuItem2
VALUE='GrownUps .info'>");
document.write( " <PARAM NAME=MenuLocati on2
VALUE=http://www.GrownUps.in fo>");
document.write( " <PARAM NAME=siteID VALUE=1000>");
document.write( " <PARAM NAME=background
VALUE=FFFFFF>") ;
document.write( " <PARAM NAME=signed VALUE=true>");
document.write( " <PARAM NAME=textcolor
VALUE=000000>") ;

// Integration Here
document.write( " <param name=nickname
value=$_POST['name'][arrayindex]>");
# document.write( " <param name=nickname
value='{$ibforu ms->member['name']}'>");
# document.write( " <param name=email
value='{$ibforu ms->member['email']}'>");

document.write( " GrownUpsChat requires a Java
Compatible web browser to run. ");
document.write( " </APPLET>");

</script>
EOF;

print($this->output);
exit();

}
}
}

// End Basic DigiChat Integration v1.0 hack
//--------------------------------
?>
Jul 17 '05 #1
1 2707
Hey Eric,

how are you using this file? Are you actually instantiating it in some
way? Viewing it directly won't produce anything. It needs to be called
from somewhere. Maybe you missed a step in the instructions?

Eric Wagar wrote:
I have a phpnuke website, and I use DigiChat chat. Since I have
users who register, I'd like to be able to pass there username and
email (at a minimum) into the chat system, so they do not have to
enter in their information multiple times.

I am attempting to use the below file (which was obtained from a
website using DigiChat and something called IBForums), but I am not
able to get any output on the page when using it. Any help?

Thanks
Eric

<?php

//--------------------------------
// Basic DigiChat Integration v1.0 hack by InvisionHacks(t m)
// Copyright 2004 Chris Griego [cgriego]
// http://www.invisionhacks.com/

//class module extends module_loader
{
// var $output = "";

function module()
{
global $fg_phpnuke,
$print,
$std;

$ibforums->lang['digichat_guest '] = "You must
register with our forums to use our chat feature.";

if (!$fg_phpnuke->nuke_users['user_id'])
{
// If a guest, error.
$std->Error(array('L EVEL' => 1, 'MSG' =>
'digichat_guest '));
} else {
$this->output = <<<EOF

<head>
<title>Chat Entry</title>
</head>
<body bgcolor="white" text="black" link="blue" vlink="purple"
alink="red" leftmargin="0" marginwidth="0" topmargin="0"
marginheight="0 "> <div align="left">
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%"
height="100%"> <tr>
<td align="center" valign="top" width="100%"
background="blo ck.title.png" height="20">&nb sp;</td>
</tr>
<tr>
<TD HEIGHT="100%" ALIGN="left" VALIGN="top" style="margin:0 ;
padding-top:0pt; padding-right:0pt; padding-bottom:0pt;
padding-left:10pt;"> <p align="left"><f ont face="Verdana"> Be patient
while chat<br>loads.</font></p>
<p align="left">&n bsp;</p>
</td>
</tr>
</table>
</div>
</body>
</html>

<script language="JavaS cript" type="text/javascript">

isMac =
(navigator.appV ersion.indexOf( "Mac")!=-1) ? true : false;
IEmac = ((document.all) &&(isMac)) ? true :
false; IEwin =
((document.all) &&(navigator.ap pVersion.indexO f("MSIE")!=-1) &&
!isMac) ? true : false;
NS =
(navigator.appN ame.indexOf("Ne tscape")!=-1) ? true : false;

document.writel n("<APPLET NAME='DigiChat'
CODEBASE='http://www.flyguylive. com/DigiChat/DigiClasses/' ");

document.writel n("CODE='com.di ginet.digichat. client.DigiChat Applet'
"); if (isMac)

document.writel n("ARCHIVE=Clie nt_Mac.jar MAYSCRIPT>");
else if (!isMac)
{
if (IEwin)
{

document.writel n("ARCHIVE=Clie nt_Plugin.jar MAYSCRIPT>");
document.write( " <PARAM
NAME=cabbase value=Client_IE .cab>");
document.write( " <PARAM
NAME=useslibrar y value=DigiChat Applet>");
document.write( " <PARAM
NAME=namespace value=Digi-Net>");
document.write( " <PARAM
NAME=useslibrar ycodebase value=Client_IE .cab>");
document.write( " <PARAM
NAME=useslibrar yversion value=4,0,1,0>" );
}
else if (NS)

document.writel n("ARCHIVE='Cli ent_NS.jar' MAYSCRIPT>");
}

document.write( " <PARAM NAME=MenuItem1
VALUE=GrownUpsM eet.com>");
document.write( " <PARAM NAME=MenuLocati on1
VALUE=http://www.GrownUpsMee t.com>");
document.write( " <PARAM NAME=MenuItem2
VALUE='GrownUps .info'>");
document.write( " <PARAM NAME=MenuLocati on2
VALUE=http://www.GrownUps.in fo>");
document.write( " <PARAM NAME=siteID
VALUE=1000>"); document.write( " <PARAM
NAME=background
VALUE=FFFFFF>") ;
document.write( " <PARAM NAME=signed
VALUE=true>"); document.write( " <PARAM
NAME=textcolor
VALUE=000000>") ;

// Integration Here
document.write( " <param name=nickname
value=$_POST['name'][arrayindex]>");
# document.write( " <param name=nickname
value='{$ibforu ms->member['name']}'>");
# document.write( " <param name=email
value='{$ibforu ms->member['email']}'>");

document.write( " GrownUpsChat requires a Java
Compatible web browser to run. ");
document.write( " </APPLET>");

</script>
EOF;

print($this->output);
exit();

}
}
}

// End Basic DigiChat Integration v1.0 hack
//--------------------------------

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
72166
by: Jonas Daunoravicius | last post by:
The subject pretty much sums up what I need to do. Here is what I have so far, but still can't figure out how to get it working: <script language="javascript" type="text/javascript"> function fillForm() { // split the query string into pieces var qs = location.search.substr(location.search.indexOf("?")+1); qs = qs.split("&"); alert(qs); // qs is the variable that I need to pass into a
1
2578
by: Patrice | last post by:
Hi, I'm trying to use a javascript function passing a vb variable. I don't understand why it doesn't work. Can someone help me? Thanks in advance. Here is my javascript function used to show a text:
2
5060
by: RootShell | last post by:
Hello First of all i know that PHP is a server side, and JavaScript is a Client side programming language, but i need to know if there is any way i can add the variable "countDownInterval" from this particular FULL code into a MySQL field. Here's the drill: I have a timer on a PHP webpage, and i want to prevent the user from doing a
5
2176
by: Jim Banks | last post by:
Greetings I'm opening a pop up window with a html form, (in one document) and I want to pass a variable to the html form called from the hyperlink. Here's the code I'm using to pop up the window and call the form. In this particular instance, a city name is what I have to pass to the form Chapter.htm. <html> <head>
4
1384
by: baccaril | last post by:
Hello, I have a form the post to a php script, the variable is passed to the php script successfully. I then query MySQL and output 8 rows at a time. So the problem I'm having is the first 8 rows are displayed on the web page correctly, but now when I attempt to display rows 9-16 the variable that was posted from the form is now blank. How do I ensure the variable does not disappear? LouB.
11
3824
by: kennthompson | last post by:
Trouble passing mysql table name in php. If I use an existing table name already defined everything works fine as the following script illustrates. <?php function fms_get_info() { $result = mysql_query("select * from $tableInfo") ; for ($i = 0; $i < mysql_num_rows($result); $i++) {
2
1967
satterfieldben
by: satterfieldben | last post by:
I have a newbie question about passing variables between functions. I am wanting to use a drop down box to select a value. Then base on which was selected, it would create a variable and I would call that variable in another Java script. Sample script <SCRIPT LANGUAGE="JavaScript"> function GetSelectedItem() { len = document.formname.selectname.length i = 0 chosen = "none"
1
4838
by: pretzelboy | last post by:
Hi, I last wrote software 13years ago in the pascal, dbase, clipper days. I have recently built a Ubuntu Box and with C++ (and help from the web) setup a serial barcode reader program using Mysql database tables. All works well, and I can do what I need except I am having some trouble with applying an MySQL query result into a defined variable. This would seem like such an easy thing to do. The only examples I can find out there are...
0
9537
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9319
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9243
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8241
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6795
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4599
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4869
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3309
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2213
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.