Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

client side Perl processing

Status
Not open for further replies.

rshandy

Technical User
Dec 26, 2003
91
US
Read some spirited posts from Phalanx1 and Siberian, so I know the expertise is out there...

I'm trying to have a perl script process an html page from an html page without opening another browser window or redirecting or refreshing the page.

The Perl script has to interpret my SoftCart tags and then write them to a txt file.

I was able to do everything except to get SoftCart to interpret the tag. In order for softcart to interpret the tag the page has to be parsed using cgi-bin/SoftCart.exe in the url - i.e. has to reparsed to:

I call the pl script 2 ways:

1) in the header of the html page:

<script language="JavaScript1.2" src="
2) <a href=" name="mw_1624_sw" src="graphics/mw_1624_sw.jpg" width="80" border="0" ></a>

The simple test pl script is as follows:

#!/usr/bin/perl -w
use strict;
use CGI qw:)standard);
my $upname10="selector10.txt";
my $upname11="selector11.txt";
my $upname12="selector12.txt";
open (File12, ">$upname12" || die "Error opening file $upname12");
print "Content-type: text/html\n\n";
print"<header>";
print<<DDPENWE1;
<title> crates test</title>

<SCRIPT LANGUAGE="JavaScript">

SCPath = "/cgi-bin/SoftCart.exe";
config = "scstore";
if (location.pathname.substring(0,SCPath.length)!= SCPath) {
window.location.replace(SCPath + location.pathname + "?E+" + config);
}

</Script>
</head>
DDPENWE1
print File12 "Checking,";

print File12 "checking,";

print File12 "checking the cell structure,";

print File12 "Just a scene from Sleeper!";
print File12 "%%product(99901BB).micro_description%%";
close (File12);

my $description = "%%product(99901BB).micro_description%%";


open (File10, ">$upname10" || die "Error opening file $upname10");
print File10 "check this out now ";
print File10 "So, now you think you're working!!!!";
print "Below is the description of SKU 99901BB that has been properly interpreted by SoftCart:<br><br>";
print "<b>%%product(99901BB).micro_description%%</b>";
close (File10);
open (File11, ">$upname11" || die "Error opening file $upname11");
print File11 "check this out now 11112222222222222222222255555555555511111111";
print File11 "\n\nwell, we're waiting!!!!!!!!!!!!!!!!!!";

print File11 "\n\n oh, now we're cooking with gas!!!\n\n";
print File11 $description;
print File11 "%%product(99901BB).micro_description%%";
close (File11);

When I call the pl script from the graphic link, its works just fine, but takes to another page.

When I call the pl script from the JS it give me a syntax error... it doesn't like the javascript in the pl script - when I remove the js code <SCRIPT LANGUAGE="JavaScript">, etc. , the script works BUT without interpreting the SoftCart tag.

Very frustrated!!!!!

How do I call the pl script to have it function like it does from the graphic call WITHOUT changing the existing page?

Thanks,

Rich
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top