Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling functions from a FRAME tag 1

Status
Not open for further replies.

mstembri

Technical User
Dec 26, 2000
3
US
Is this possible, if so, how is it done?

The function (which I've already made) is to grab the document.referrer variable and pass it to a php page via query string.

Passing via query string seems to be the simplest, most troublefree method of getting HTTP_REFERER to my php script.

Thanks in advance.
 
window.location="mypage.php?therefferer="+window.location jared@aauser.com
 
you can set the source of the frame without calling a function in src="". just say: parent.frames[num].location = ="mypage.php?therefferer="+document.referrer; adam@aauser.com
 
parent.frames[num].location = ="mypage.php?therefferer="+document.referrer;

to use lucid's, remove the bold ='s sign above jared@aauser.com
 
<frame name=&quot;bottom&quot; parent.frames[num].location==&quot;test.php?therefferer=&quot;+document.referrer;>

When I use this in the frameset, the &quot;bottom&quot; frame is completely empty (ie, when I view source all I see is <HTML></HTML>).

Am I missing something important?
 
parent.frames[num] - num here is the index of the frame, if you want frames 2, num=1 jared@aauser.com
 
yeah, dont forget to do what jared said, i accidentally typed an extra =, so, take that out. adam@aauser.com
 
Ok, this isn't a JavaScript solution, if that's what you want, but doesn't PHP have the HTTP variables accessible the same way JavaScript does? I'd look into the PHP documentation if I were you. Chances are you can get HTTP_REFERER directly from PHP.
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
Well, I happen to know php's $HTTP_REFERER variable does the same thing as document.referrer. In fact if I could use php to do the task I need I'd only need three short lines of code.

The problem is that the site I'm working on is already entered in all the search engines with index.html as the indexing page. Simply changing the index to a .php file is not a viable solution at this juncture.

I'm sure you already see the issue -- $HTTP_REFERER only stores the referring page, not a multi-document history of referring pages. Simply redirecting with a meta tag would work fine, but the $HTTP_REFERER variable would contain index.html, not the actual referring site (assuming there is one). That is why I need Javascript to pull the document.referrer variable and pass it along to one of my php pages where it will be processed.

Glad you asked, though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top