Solved

CGI

Posted on 1999-01-16
9
511 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Tool to Build Android and iOS App 3 76
Animated .jpg? 13 79
Some AHK commands fail in Microsoft OneNote 5 48
Make Line Items Look Good Over Mobile 2 60
Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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…

773 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