Announcement

Collapse
No announcement yet.

Tokens

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Tokens

    I need to create a link to a MLS listing for my site and in order to do that I need to get a Token from the site so that they know it is me. They gave me Perl as an example but not PHP does anyone have PHP code on how to get a Token here is the example Perl code they gave me.

    Also do I have to set up my page as php or do I create an html page and then pull in html code and put the php code in there. I am not sure how to do any of this so any help would be appreciated.

    Thanks!

    perl code example:

    #!/usr/bin/perl -w
    #
    # This script MUST be placed on the server (or behind the proxy server) that uses
    # the IP addresses you provided when signing up to work. You must also set the ID
    # number where noted below.
    #
    # I have tested and gotten this to work on both the i386 linux (Slackware), and
    # NT 2000 platforms.
    #
    # LWP::Simple is a module included in the libwww-perl package, and SHOULD be availabe
    # on most servers running perl for CGI scripting purposes.
    # The most current ver. of the libwww-perl package as of the writing of this is
    # libwww-perl-5.64.tar.gz and is available for dload at http://www.cpan.org
    # It can be directly ftp'd from ftp.cpan.org from /pub/CPAN/modules/by-module/LWP/.
    # If you need further functionality or would rather write your own interface script,
    # you might find the modules IO::Socket and URI, or LWP::UserAgent (the 'full' version of
    # LWP::Simple) usefull. These can also be found in the libwww package.
    use LWP::Simple;
    # You must replace the pid below ('19' in this example) with your ID (939 mine )number that
    # you recieved after applying for IDX access.
    $token = get("http://token.hhi.marketlinx.com/tokeninit.asp?pid=[939]");
    # Everything below between the END_of_HTML block tokens is just basic HTML.
    # This can be edited to suit whatever needs you might have. I've included a very
    # basic frameset but this can be changed to be as much as it needs to be.
    #
    # One note here, Perl uses the '\' char to force printing of command characters.
    # IE, if you need to actually print out '$money' for instance instead of having this
    # script think that $money was variable you would need to type it as '\$money'.
    # This shouldn't be an issue, but if you see funny things happen here with HTML code
    # keep that in mind. I believe I have had an instance or two where I've had to preceed
    # the " char with a backslash. It probably depends on what ver. of Perl that is being used
    # on the server side.
    print <<END_of_HTML;
    Content-type: text/html
    <html>
    <head>
    <title>some title</title>
    </head>
    <frameset rows="15%,*">
    <frame name="header" target="main" src="http://www.morellasite.com/mls.html">
    <frame name="main" src="http://idx.hhi.marketlinx.com/templa...asp?sec=$token">
    </frameset>
    </html>
    END_of_HTML
Working...
X