• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

grabbing html from a separate page using php

ultra

New Member
please, please, please help me.

i've tried 4cm and Contentgrabber v1.5, both "kinda" work for me but the images didnt show up. please help me

this is a little related to keith's post: http://www.freewebspace.net/forums/showthread.php?s=&threadid=8507
"if you right click the page and hit 'properties', you'll see the page reads as keith.wzr.net. so it appears that keith.wzr.net is a real domain rather than a redirect.

but if you right click on an image and hit 'properties', you'll see it reads 'keith.wzr.net/imagename.jpg'. so not only does it load the html through the subdomain, it looks like the subdomain is actually hosting the images. "
thanks in advance
 
Last edited:
if you can do this perl, it's a lot easier.

use LWP::Simple;

$page = get($URL);
@text = split(/\n/, $page);

That's all I know.
 
thanks for the quickest reply!

ok, i see variables where do i put the url? and what's the extension of the file .pl?

ty
 
well, you can put the URL in get(""); in the "".
Have a variable be assigned to this.

i.e. you want to grab freewebspace.net/forums:

use LWP::Simple;

Put that at the top of your page after #!/usr/bin/perl

then use:

$page = get("http://www.freewebspace.net/forums/");
 
hmmm. im very newbie to this stuff. =( can you elaborate. i only know #!/usr/bin/perl

can you give me real code example.

ty
 
Code:
#!/usr/bin/perl

# get modules LWP and CGI
use LWP::Simple; # for grabbing stuff
use CGI qw/:param/ # so you can use forms, etc.

print "Content-type: text/html\n\n"; # print content-type


# if you want to get a URL from the user and have it print it out

$URL = param("URL"); # file.cgi?URL=whatever -- the variable will recieve "whatever"

if ($URL){ # check if URL is empty. if it is, print out the form
print<<FORM;
<form action="file.cgi">
Enter URL: <input type=text name="URL">
</form>
FORM

# the block above allows you to expand and not use "" all the time --^
}
# this block of code gets the page and prints it out
else { getprint($URL) }
 
Last edited:
Back
Top