Forum Moderators: coopster & phranque

Message Too Old, No Replies

How to display query results in the same webpage

         

wjbarton

11:34 pm on Mar 3, 2004 (gmt 0)

10+ Year Member



Ok, newbie question here. I can do DBI queries in Perl and I can make web pages, but how in the world to I create an html page that invokes DBI queries that will show in the same web page? Can someone point me in the right direction?

Thanks!

- WJB

Hissingsid

2:36 pm on Mar 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

In effect you don't. The query goes to the server and new HTML is sent to the browser. In its simplest form you just use the same HTML code in a print here with variables swopped for your result.

print <<"HERE";

<html>
$result
</html>

HERE

If your images are exactly the same as the query page this will load very quickly.

If you want to have code load into exactly the same web page without a trip back to the server you could load an external Javascript file into the browser cache formatted as a Hash of arrays. This will stay in the browser cache and when queried by Javascript returns results almost instantaneously. The downside is the fact that the data has to be in the browser cache before it starts working.

Best wishes

Sid