Sorry i didnt mean to poorly word my question
but what i want to do is spider a webpage for a bit of information and then display it on a PHP website
i got some coding from another site
In perl:
<%
use LWP::Simple;
use strict;
my $server = 'http://www.asx.com.au';
my $url = '/asx/markets/PriceResults.jsp';
my $args = '?method=get&template=F1001&ASXCod* es=CML';
my $content = get("$server$url$args");
if (defined $content) {
my ($str) = ($content =~ /<td\s+class='last'>\s*([0-9* \]+)\s*<\/td>/si);
if (defined $str) {
my $num = $str; $num =~ s/\.//g;
my $res = $num * 3;
my $sres = sprintf('%.3f', $res/1000);
$sres =~ s/\./,/;
%>CML: <%= $str %> x 3,000 = <%= $sres %> <%
} else {
%>Not readable<%
}
} else {
%>Not available<%
}
%>
In PHP:
if ($page = file_get_contents('http://www.asx.* com.au/asx/markets/PriceResults.js* p?method=get&template=F1001&ASXCod* es=CML')) {
if (preg_match('|<td\s+class=\'las* t\'>([0-9]*)</td>|i', $page, $match)) {
$price = $match[1];
echo $price;
}
}
and heres my server stats
Operating system Linux Service Status Click to View Kernel version 2.6.9-22.0.1.ELsmp Machine Type i686 Apache version 1.3.34 (Unix) PERL version 5.8.7 Path to PERL /usr/bin/perl Path to sendmail /usr/sbin/sendmail Installed Perl Modules Click to View PHP version 4.4.1 MySQL version 4.1.14-standardi would appreciate your help on this issue because i have never got those 2 pieces of code to work no matter what i do
|