View Full Version : .php?Serv?=IrcServer ?chan?= ChannelName
boxxertrumps
09-06-2006, 08:07 PM
i am repuesting a php script that lets me use a single php file with an IRC applet in it to connect to different IRC networks/channels by just changing the url
im a Complete Noob at PHP but this is how i understand it would be structured:
url: www . boxxer.com/irc/heavyapplett .php?Serv?=IrcServer?chan?=ChannelName
<?php
echo ('first part of IRC script')
echo ('Serv -server url')
echo ('middle part of IRC script')
echo ('chan -channel name')
echo ('Last Part Of IRC Script')
/php>
i have no idea how any of this works so please excuse my Inability to cope with a PHP enviroment.
boxxertrumps
09-06-2006, 08:14 PM
Cleaned up my example:
<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="newb?"/>
<param name="alternatenick" value="noob??"/>
<param name="name" value="JavaUser?"/>
<param name="host" value="<?php echo $_GET['host']; ?>"/>
<param name="gui" value="pixx"/>
<param name="command1" value="/join <?php echo $_GET['chan']; ?>"/>
<param name="quitmessage" value="Disconnected"/>
other PARAMs then </applet>
<a href="HeavyApplet.php?host=irc.rizon.net&chan=#ASRadio">Arma Systama Radio</a><br />
showed an example url too.
djr33
09-07-2006, 05:36 AM
You're talking about GET statements.
You can use a form: <form action="next.php" method="GET">
Or, use a link/etc. like you're using-- <a href="next.php?a=b">
The way they work is VERY simple--
page.ext?VARIABLE=VALUE
Where VARIABLE is the name of the variable, and VALUE is the value of that variable.
If you want more than one variable, it's:
?var1=val1&var2=val2
You only use one ? and &'s between each new variable, with the name then = then the value.
Once that's in your URL, in your php, use this code:
<?php echo $_GET['varname']; ?>
If the URL was page.php?username=djr33,
<?php echo $_GET['varname']; ?>
would output "djr33" into your html.
That's it.
blm126
09-07-2006, 09:26 PM
If you want more than one variable, it's:
?var1=val1&var2=val2
You only use one ? and &'s between each new variable, with the name then = then the value.
Correct, but ; is a valid replacement for &
boxxertrumps
09-07-2006, 11:43 PM
Thanks Awsome, but is php valid like this?
<param name="host" value="<?php echo $_GET['host']; ?>"/>
if it is, awsome, im set...
boxxertrumps
09-08-2006, 12:47 AM
Heres What I Get in the IRC feild...
[20:46] Connecting...
[20:46] Unable to connect : java.security.AccessControlException : access denied (java.net.SocketPermission irc.rizon.net resolve)
blm126
09-08-2006, 01:39 AM
<param name="host" value="<?php echo $_GET['host']; ?>" />
Is correct. View the source of the page and see if the HTML outputted by PHP is correct.
Heres What I Get in the IRC feild...
[20:46] Connecting...
[20:46] Unable to connect : java.security.AccessControlException : access denied (java.net.SocketPermission irc.rizon.net resolve)That's correct, yes. Java applets, like XMLHttpRequest, are only allowed to connect to the server from which they were served. If you sign your applet, it can request permission from the user to go beyond the security limitations.
boxxertrumps
09-09-2006, 12:20 AM
"#" Wont $_get And Echo!
# is a reserved character in URLs. You need to escape it.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.