Results 1 to 10 of 10

Thread: .php?Serv?=IrcServer ?chan?= ChannelName

  1. #1
    Join Date
    Jun 2006
    Location
    Acton Ontario Canada.
    Posts
    677
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default .php?Serv?=IrcServer ?chan?= ChannelName

    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.
    Last edited by boxxertrumps; 09-07-2006 at 01:08 AM.
    - Ryan "Boxxertrumps" Trumpa
    Come back once it validates: HTML, CSS, JS.

  2. #2
    Join Date
    Jun 2006
    Location
    Acton Ontario Canada.
    Posts
    677
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default IRC applett code

    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.
    Last edited by boxxertrumps; 09-09-2006 at 01:04 AM.
    - Ryan "Boxxertrumps" Trumpa
    Come back once it validates: HTML, CSS, JS.

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #4
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    Quote Originally Posted by djr33
    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 &

  5. #5
    Join Date
    Jun 2006
    Location
    Acton Ontario Canada.
    Posts
    677
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Thanks Awsome, but is php valid like this?
    <param name="host" value="<?php echo $_GET['host']; ?>"/>
    if it is, awsome, im set...
    - Ryan "Boxxertrumps" Trumpa
    Come back once it validates: HTML, CSS, JS.

  6. #6
    Join Date
    Jun 2006
    Location
    Acton Ontario Canada.
    Posts
    677
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    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)
    - Ryan "Boxxertrumps" Trumpa
    Come back once it validates: HTML, CSS, JS.

  7. #7
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    Code:
    <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.

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    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.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  9. #9
    Join Date
    Jun 2006
    Location
    Acton Ontario Canada.
    Posts
    677
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    "#" Wont $_get And Echo!
    Last edited by boxxertrumps; 09-09-2006 at 12:51 AM.
    - Ryan "Boxxertrumps" Trumpa
    Come back once it validates: HTML, CSS, JS.

  10. #10
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    # is a reserved character in URLs. You need to escape it.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •