473,320 Members | 1,921 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,320 software developers and data experts.

How to display output of perl on a webpage

Actually I am creating a database by the help of perl and mysql, part of retrieving has been done through perl but now I can't understand how to display it's output on a webpage.So can anyone tell me how to do this?

code is:
Expand|Select|Wrap|Line Numbers
  1. # PERL MODULES WE WILL BE USING
  2. use DBI;
  3. use DBD::mysql;
  4.  
  5.  
  6. # CONFIG VARIABLES
  7. $platform = "mysql";
  8. $database = "purchase";
  9. $port = "3306";
  10. $host = "localhost";
  11. $user = "root";
  12. $pw = "";
  13.  
  14. #DATA SOURCE NAME
  15. $dsn = "dbi:mysql:$database:localhost:3306";
  16.  
  17.  
  18. # PERL DBI CONNECT
  19. $DBIconnect = DBI->connect($dsn, $user, $pw)or die "unable to connect:$DBI::errstr\n";
  20.  
  21. #PREPARE THE QUERY
  22. $query = "SELECT * FROM naipone WHERE Fileno = '4-56/2008-09/AG(S)'";
  23. $query_handle = $DBIconnect->prepare($query);
  24.  
  25. #EXECUTE THE QUERY
  26. $query_handle->execute();
  27.  
  28. #BIND TABLE COLUMNS TO VARIABLES
  29. $query_handle->bind_columns(\$Sanctionamt, \$Availableamt, \$Dateoffirstrelease, \$Amtoffirstrelease, \$Dateofsecondrelease, \$Amtofsecondrelease, \$Netamt, \$Fileno, \$fileinitiation, \$nameofindenter, \$materialreceivedpurchasedandpaymentreleased, \$nameoffirm, \$completeaddressoffirm, \$head, \$subhead, \$sanctioneddate, \$sanctionedamt, \$progressivebal, \$sanctionedbal, \$billdate, \$billamt, \$billbal);
  30.  
  31.  
  32. #LOOP THROUGH RESULTS
  33. while($query_handle->fetch())
  34. {
  35. print"$Sanctionamt,$Availableamt,$Dateoffirstrelease,$Amtoffirstrelease,$Dateofsecondrelease,$Amtofsecondrelease,$Netamt,$Fileno,$fileinitiation,$nameofindenter,$materialreceivedpurchasedandpaymentreleased,$nameoffirm,$completeaddressoffirm,$head,$subhead,$sanctioneddate,$sanctionedamt,$progressivebal,$sanctionedbal,$billdate,$billamt,$billbal <br>";
  36. }
Feb 11 '13 #1
1 2051
RonB
589 Expert Mod 512MB
Do you have a web server?

If so, is it setup correctly to execute scripts and is the script in the proper location (as specified in the web server config) and does it have the correct permissions?

Once you verify those requirements and possibly a couple others, your script will need to output the proper content-type header prior to any other output.

http://www.tutorialspoint.com/perl/perl_cgi.htm

http://search.cpan.org/~markstos/CGI.pm-3.63/lib/CGI.pm
Feb 11 '13 #2

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

Similar topics

0
by: Drydo | last post by:
In short, is it possible to swap/change the display output of a laptop to a CRT programmatically? The scenario is that we have a laptop that at the startup of a specific application would...
6
by: radnoraj | last post by:
Hi, I am sucessfull in redirecting console output to a file. but in this case nothing is displayed on the console, cout output is written to file without display. how do write the output to...
3
by: robin9876 | last post by:
In an asp.net (VB) web page I have created a HTML table that has some server side labels which has information populated to at runtime from code. This works for when there is only one recorded...
3
by: Rich | last post by:
Hi, I'm very, very new to javascript, so please bear with me if this is a silly question. My problem is this. I would like to some javascript connect to a URL on the same webserver and...
0
by: Luke Herbert | last post by:
I am very new to C# and have been trying to get to grips with it by writing a small tool to detect a USB key being inserted and then backup user specified files to the key. I have written some...
0
by: netventuresmarketing | last post by:
Ok so you have already figured out with a name like netventuresmarketing that Im a Internet marketing type trying to teach myself some simple PHP. I purchased a turnkey program to set up a free...
3
by: lokeshrajoria | last post by:
Hello Everyone, I am running Perl in Linux 9.0 but after writing simple hello program not getting output. despite of compile sucessfully and i set path of perl. Please do...
2
by: gmtheodore | last post by:
I am using PDF::Create to dynamically create PDF on the fly. That works. I end my code with the $pdf->close; and the pdf file is created. I now want to display it in a browser. Here is the...
1
by: Guna Raj | last post by:
How can we access the database field using PHP and display it in web page. Suppose there is a text box where the user can enter thier ID. All the corresponding field related to that ID should be...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.