Solved

CGI

Posted on 1999-01-16
9
500 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
  • 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
 

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How to count json data 2 56
website content maintenance 3 57
Combine DSQuery result into loop script 6 39
Problem to page 4 26
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn how to count occurrences of each item in an array.

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now