Solved

CGI

Posted on 1999-01-16
9
516 Views
Last Modified: 2013-12-25
i need a cgi that can save an URL output to a file! but this cgi must not using LWP libs or others lib!
examples:
input ot this cgi is http://www.geocities.com/cgi-bin/members?id=tulung
and then the cgi save the html output from this url to a file.
but this cgi must not using any libs! (pleaseeee...)
can anyone help me?.. please...
0
Comment
Question by:tulung
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 1

Expert Comment

by:sdjjm
ID: 1832289
I don't understand what it is you are trying to do.  Are you trying to take the output from an HTML form and save it in a file via a CGI?  Or are you trying to take the output from one of Geocities' CGI scripts and save that data to a file?
0
 

Author Comment

by:tulung
ID: 1832290
correct!... i want to take an output of HTML and saved to a file via a CGI, GEOCITIES Cgi Script is only an example!
0
 
LVL 1

Expert Comment

by:sdjjm
ID: 1832291
This will take the output from an HTML form and put it in a file for you...

#!/usr/local/bin/perl
&parse;
open (LOGFILE, ">>yourfile.log");
$newline=join('::',@value);
print LOGFILE ("$newline\n");
close LOGFILE;
exit;
sub parse {
read(STDIN,$user_string,$ENV{'CONTENT_LENGTH'});
if (length($ENV{'QUERY_STRING'})>0) {$user_string=$ENV{'QUERY_STRING'}};
$user_string =~ s/\+/ /g;
@name_value_pairs = split(/&/,$user_string);
foreach $name_value_pair (@name_value_pairs) {
        ($keyword,$value) = split(/=/,$name_value_pair);
        $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/ge;
        push(@value, "$value");
        $user_data{$keyword} = $value;
        };
};

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:tulung
ID: 1832292
I thing you don't understand what i want.
If we type an url in a browser, the browser will show an html.
now i want a cgi, that if we input an url (get or POST method) the cgi will redirect to the url, and then the cgi will save the html that should be shown to a file.
are you still not understand?

let's we talk about others examples,
i want my cgi save the www.microsoft.com html!, i can save the html by visiting the site and then with my browser i choose file/save as. but i want my cgi to do it! do i don't need to enter the www.microsoft.com to save the html of www.microsoft.com site!
and of course this cgi must be working to url such as
http://www.tripod.com/cgi-bin/members?id=tulung

so when i enter this url, the cgi will search the url and then the cgi will save the html that generated by the tripod cgi!

JUST like GET (LWP lib), but i don't this script using this lib or others lib!..

i'm sorry about my bad grammer!

Thanks

0
 
LVL 8

Expert Comment

by:jhurst
ID: 1832293
You really made this impossible by not allowing the use of a library.  The problem that you have is that you need the cgi on whatever server is processing the cgi to open an http: connection to another site.  Such http connections need libraries, at least they do when written in anything normal, like C, C++, Perl, shell-script, etc.  

If you have access to C or any other real language you could reverse engineer such a library and make the http connection that you need but really this is like using the library in the first place.  

I assume that you do not want to use a library because you server will not allow you to load them.  If this is the case they are unlikely to be silly enough to give you the power to make your own.  SO you are out of luck.
0
 

Author Comment

by:tulung
ID: 1832294
i'm using win32 platfom, and i don't know how to use lib in perl for win32, you may help me!
i have libwww 4.0, but i don't know how to use it! so i try to ask, did there is another way to do that!

0
 
LVL 8

Expert Comment

by:jhurst
ID: 1832295
NO!

This is what we are trying to tell you!
0
 

Author Comment

by:tulung
ID: 1832296
ok, now i change my question, how to use lib in perl for win32?
i have libwww 4.0 but i don't know how to use it, can you explain it to me, how to install a lib so i can use the lib?
must be specific cause i don't know how to install it!

0
 
LVL 1

Accepted Solution

by:
sdjjm earned 200 total points
ID: 1832297
This location will tell you how to install a lib and use it to capture an HTML page like you want...

http://webreview.com/wr/pub/98/10/30/perl/index.html
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question