By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,179 Members | 970 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,179 IT Pros & Developers. It's quick & easy.

How do I get hold of the browser window tite

P: 4
How do I get hold of the browser window tite in my perl script????
Aug 22 '08 #1
Share this Question
Share on Google+
6 Replies


numberwhun
Expert Mod 2.5K+
P: 3,503
Just looking at a list of HTTP environment variables , I don't know if you can.

Regards,

Jeff
Aug 23 '08 #2

KevinADC
Expert 2.5K+
P: 4,059
NO, the title is part of the html code not the environment variables. He will need to use a module like LWP::Simple or parse the html by hand. But his requirement is so vague I am really not even sure what he wants to do.
Aug 23 '08 #3

P: 4
NO, the title is part of the html code not the environment variables. He will need to use a module like LWP::Simple or parse the html by hand. But his requirement is so vague I am really not even sure what he wants to do.
I have a webpage which you can access from two different sites - let's say A and B. The content of the web page is always the same but there are two differencies depending of the origing web page:1. The window title, 2. the url in the adress bar in the browser window. My task is to do something with the webpage (in which my perl script is running) but only in the case the user comes from web page A. So this is why I need to get hold of either the url or the window title. I have tried to read the url using the different $ENV variables like QUERY_STRING, REQUEST_URI and HTTP_REFERER but these variables did not return anything. That's why my second attempt to solve this task is to get hold of the window title.

/Emmalo
Aug 25 '08 #4

KevinADC
Expert 2.5K+
P: 4,059
I have a webpage which you can access from two different sites - let's say A and B. The content of the web page is always the same but there are two differencies depending of the origing web page:1. The window title, 2. the url in the adress bar in the browser window. My task is to do something with the webpage (in which my perl script is running) but only in the case the user comes from web page A. So this is why I need to get hold of either the url or the window title. I have tried to read the url using the different $ENV variables like QUERY_STRING, REQUEST_URI and HTTP_REFERER but these variables did not return anything. That's why my second attempt to solve this task is to get hold of the window title.

/Emmalo
I don't think perl can get the title of a webpage in the manner you want it to. REQUEST_URI sounds like the way to go, I use it myself fo make sure perl scripts are being called from a certain webpage.

Perl has no hooks into a browser window, that would be javascript. Javascript can only communicate with perl on the server via the query string or post data.
Aug 25 '08 #5

P: 4
I don't think perl can get the title of a webpage in the manner you want it to. REQUEST_URI sounds like the way to go, I use it myself fo make sure perl scripts are being called from a certain webpage.

Perl has no hooks into a browser window, that would be javascript. Javascript can only communicate with perl on the server via the query string or post data.
I have already tried the REQUEST_URI but I don't get anything back. I have tried to print all ENV variables and there are quite a few that are "blank", liek those I mentioned earlier. Why is it so?
Aug 25 '08 #6

KevinADC
Expert 2.5K+
P: 4,059
I have already tried the REQUEST_URI but I don't get anything back. I have tried to print all ENV variables and there are quite a few that are "blank", liek those I mentioned earlier. Why is it so?

a proxy server can do that.
Aug 25 '08 #7

Post your reply

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