Solved

CGI

Posted on 1999-01-16
9
524 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
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 

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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
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…
The viewer will learn how to dynamically set the form action using jQuery.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

707 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