Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Including perl script in a html page
Old 01-23-2007, 01:29 AM Including perl script in a html page
Novice Talker

Posts: 7
Name: Andrew
Trades: 0
Hi guys,

Im pretty new to all this PHP, PERL, ASP ect. I have only just got used to HTML with the help of dreamweaver though.

I have set up a website here and would like to place an advertising space on it. The website is written in HTML throughout. I have registered with a link broker "backlinks.com" and they require me to paste dynamic scrips into my page so that the process of displaying the links is automated.

The bit I dont understand is how I get the code to work in my webpage. I do have a choice on what code to use though, PHP, ASP, ASP.NET and perl. I know that I am able to use perl as it tells me in cpanel the path to perl, as for the others I'm sure I cant use because im only a bronze member for my hosting.

Ok guys... this pretty much is all I can ask questions on because my knowledge is so limited, but here is the code that backlinks.com want me to get to work on my site (without "s)

"# ************************************************** ******************
# Paste this block of code on your web page where you would like text
# links to be displayed. This code will dynamically add and remove text
# links on your web page according to your BackLinks.com settings.
# ************************************************** ******************
# The following variable defines whether links are opened in a new window
# (1 = Yes, 0 = No)
my $OpenInNewWindow = "1";
# ************************************************** ******************
# Please DO NOT modify anything below
# ************************************************** ******************
my $BLKey = "B563-039H-2YF6";
use LWP::Simple;
use URI::Escape;
my $QueryString;
$QueryString = "LinkUrl=".uri_escape((($ENV{'HTTPS'} eq 'on')?'https://':'http://').$ENV{'HTTP_HOST'}.$ENV{'REQUEST_URI'});
$QueryString .= "&Key=" .uri_escape($BLKey);
$QueryString .= "&OpenInNewWindow=" .uri_escape($OpenInNewWindow);
#Make request
my $backlinks_content = get("<A href="http://www.backlinks.com/engine.php?".$QueryString">http://www.backlinks.com/engine.php?".$QueryString);
if($backlinks_content) {
print $backlinks_content;
}"

Hope you can help guys, and thanks
90awk is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-23-2007, 02:03 AM Re: Including perl script in a html page
Novice Talker

Posts: 7
Name: Andrew
Trades: 0
just looked up my hosting plan and I do have php 4.3.8 so maybe I can use PHP?

This is the php code (without "s):

"<?php
// ************************************************** ******************
// Paste this block of code on your web page where you would like text
// links to be displayed. This code will dynamically add and remove text
// links on your web page according to your BackLinks.com settings.
// ************************************************** ******************
// The following variable defines whether links are opened in a new window
// (1 = Yes, 0 = No)
$OpenInNewWindow = "1";
// ************************************************** ******************
// Please DO NOT modify anything below
// ************************************************** ******************
$BLKey = "B563-039H-2YF6";
$QueryString = "LinkUrl=".urlencode((($_SERVER['HTTPS']=='on')?'https://':'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
$QueryString .= "&Key=" .urlencode($BLKey);
$QueryString .= "&OpenInNewWindow=" .urlencode($OpenInNewWindow);

if(intval(get_cfg_var('allow_url_fopen')) && function_exists('readfile')) {
@readfile("<A href="http://www.backlinks.com/engine.php?".$QueryString">http://www.backlinks.com/engine.php?".$QueryString);
}
elseif(intval(get_cfg_var('allow_url_fopen')) && function_exists('file')) {
if($content = @file("<A href="http://www.backlinks.com/engine.php?".$QueryString">http://www.backlinks.com/engine.php?".$QueryString))
print @join('', $content);
}
elseif(function_exists('curl_init')) {
$ch = curl_init ("<A href="http://www.backlinks.com/engine.php?".$QueryString">http://www.backlinks.com/engine.php?".$QueryString);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_exec ($ch);
if(curl_error($ch))
print "Error processing request";
curl_close ($ch);
}
else {
print "It appears that your web host has disabled all functions for handling remote pages and as a result the BackLinks software will not function on your web page. Please contact your web host for more information.";
}
?>"
90awk is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Including perl script in a html page
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.14946 seconds with 12 queries