473,396 Members | 1,780 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Display contents from html file to a webpage.How?

Hi,
I'm trying to build a perl script for the following:

1. I've a perl script from which an email is sent to specific people about the results. I've used MIME::Lite for the email. I've now used this MIME::Lite module to store the email into a html file such as xyz.html at a location on the system.
2. Now, i need to display the already created .html file on a webpage which is almost like the below example:
http:www.xyz.com/pages/editpage?123456
3. I've googled for a solution for this the entire week but didn't find any concrete solution. Thereby, please provide me some pointers or any help on how to go about this would be of great help.

Below is a script which doesn't work as per the above requirements.
Expand|Select|Wrap|Line Numbers
  1. $ua = new LWP::UserAgent;
  2. $req = new HTTP::Request GET => 'http://www.xyz.com/pages/editpage.action?pageId=197432134';
  3. $req->authorization_basic('sqabuilder', 'Pallas582_556_500');
  4. $output = $ua->request($req)->as_string;
  5. #$output =~ s!^HTTP/\d+\.\d+!Status:!;
  6. $output =~ /^Android\sAutomation\srun\son/;
  7. print "Edited page is:". $output . "\n";
  8. $uname = 'sqabuilder';
  9. $paswd = 'Pallas582_556_500';
  10.         use LWP::UserAgent;
  11.         $ua = LWP::UserAgent->new;
  12.         use Term::ReadKey;
  13.         $pf = 'Android Automation run';
  14.         $f1="confluence.html";
  15.         $weblink='http://www.xyz.com/pages/editpage.action?pageId=197432134';
  16.         open (out,"<$f1");
  17.         web_login();
  18.              $req = HTTP::Request->new(GET =>"$lne");
  19.              print outfile "updated on 30th August\n";
  20.              print outfile $ua->request($req)->as_string;
  21.              close outfile;
  22.              print "Please wait updating the changes\n";
  23.  
  24.     sub web_login
  25.     {    
  26.          print "Weblink is: $weblink \n"; 
  27.          $req = HTTP::Request->new(GET =>"$weblink");
  28.          $req->authorization_basic("$uname", "$paswd");
  29.          #$req->credentials( $uname, $paswd );
  30.          print "Please wait: attempting to login\n";
  31.          print out $ua->request($req)->as_string;
  32.          close out;
  33.     }
Thanks a lot in advance.

Rgrds,
Ramki
Sep 5 '13 #1
0 1209

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Victor | last post by:
Hi I need to open an html file from the file system and embed that html file within my main aspx form. I have 2 questions: 1) How do I open the html file? I tried the File.open(Path, mode) didnt...
6
by: Vijay | last post by:
I need to generate HTML files based on the some codes. One HTML file per code. I have the link (ex:http://123.234.345.456/WebPages/GetTestData.aspx?SomeCode=25), by passing the code as parameter I...
2
by: Adie | last post by:
I'm actually trying render usercontrols dynamicaly fraom a name stored in a db, but am have problems. My debugging attempts involve trying to write the contents of the .aspx to a label, but this is...
7
by: TLM | last post by:
I am trying to build a web application that will contain links to files on a users local computer. I am assuming that the files will be in a known location and can display in a browser window. ...
7
by: Steve Bugden | last post by:
Hi, I am trying to reference an html page from an aspx file. The intention is that the html file will contain the content for my web site and the aspx will contain the navigation, logo etc. Then...
5
by: Paul | last post by:
how can I display an HTML document that has been referred to by a SQL address? For example, I have a HTML doc called WoofInfo.htm. In a column in my SQL Server, I have the address a...
14
by: Rob Meade | last post by:
Hi all, I'm working on a project where there are just under 1300 course files, these are HTML files - my problem is that I need to do more with the content of these pages - and the thought of...
5
by: priscilla | last post by:
Hi, I am a beginer in perl programming , my task is to extract content with in form tags from a HTML file.I tried doing it using Regular expression but could not get the desired result as the HTML...
11
by: nickyeng | last post by:
I have a html file contains a form asking user to select a choice and press enter to pass the data to server. In server there, i have a cgi script(C language) that accepts the input from browser...
0
by: nehacredo | last post by:
hi alll.. i wanna display a word file content in a browser..how can i do that..i hav done one coding in that i can display the contents...but with contents some symbols also coming... anyone pls...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.