Forum Moderators: coopster & phranque

Message Too Old, No Replies

write date to current page using perl

write date to current page using perl

         

mylungsarempty

4:57 pm on Jul 15, 2003 (gmt 0)

10+ Year Member



My question is simply, can i write a Perl script to display search results dynamicly in a page you're already viewing... without actually reloading the webpage: You enter search criteria, hit the submit button, and just watch the results come up below with no completely new page generation. Does that make sense? I just started learning Perl, and i'm just curious as to whether this is possible to write. Thanks```

tschild

5:28 pm on Jul 15, 2003 (gmt 0)

10+ Year Member



You could do that if you use a frameset and specify the frame that the server's response is to be displayed in as the target attribute of the <form> tag.

Usually, though, what you want to do is done with a script like this (pseudocode):

print HTTP_headers
print start_of_HTML_page_up_to_search_form
print search_form
if (script_called_with_search_term_as_parameter) then
___get search_results
___format search_results
___print search_results
endif
print rest_of_HTML_page

mylungsarempty

5:41 pm on Jul 15, 2003 (gmt 0)

10+ Year Member



That isn't really what i was asking... thanks for the info though, it still helps as i'm so new at this, but if anybody else knows what i'm saying... dynamically updating an html page with perl... having the perl script just write directly to the same page that contains the search form, perhaps by incorporating Javascript or something? My goal i'm aiming for is having the entire site as one index.html file... i'm using pseudo-frames via layer attributes hidden and visible. If anyone's got info on this, lemme know... thankyou all.

tschild

11:20 pm on Jul 15, 2003 (gmt 0)

10+ Year Member



having the perl script just write directly to the same page that contains the search form

I don't think this is doable because when the browser issues a HTTP request to the web server the browser considers the reply a new page/file. With the frame method I described above this new page gets written into a frame, without frames the newly served page replaces the previous page in the browser window.

SinclairUser

11:45 pm on Jul 15, 2003 (gmt 0)

10+ Year Member



You can use a template and write different bodt text to it each time you submit something. But I dont really thnk you want to be doing that - do you?

I use this technique to return search results at my site for a query. You enter a search string and then the script reads in the page template - adds the body text - and then spits the page out.

netcommr

1:01 pm on Jul 16, 2003 (gmt 0)

10+ Year Member




what your looking to do is called server-push technology [google.com]

not currently supported by most browsers

try what is called client-pull,

put your dynamic results in an iframe...