How to link/jump on a specific page

R

Raymond Schmit

I have a page on my site where i would like to insert a link to jump
on another site.

This site is per exemple: http:\\www.foreignsite.com and is a framed
site. The index.html position the frames as; title.htm, menu.htm and
welcome.htm.
On the menu there is a link to change the welcome.htm to news.htm

If my link points to http:\\www.foreignsite.com the main frame is
filled with welcome.htm

How to be able to (during the jump) .... fill the main frame with the
news.htm page ?
 
J

Johannes Hafner

Raymond said:
I have a page on my site where i would like to insert a link to jump
on another site.

This site is per exemple: http:\\www.foreignsite.com and is a framed
site. The index.html position the frames as; title.htm, menu.htm and
welcome.htm.
On the menu there is a link to change the welcome.htm to news.htm

If my link points to http:\\www.foreignsite.com the main frame is
filled with welcome.htm

How to be able to (during the jump) .... fill the main frame with the
news.htm page ?

Use Javascript or (better) any server-side language (if available on
your server) like PHP. You can use the query-string (the thing behind a
? in an URL, bet you've already seen this somewhere) for submitting the
information with the link.

With javascript you can read the query-string (location.search) and
interprete it to load a specific site into the frame
(document.framename.location.href = "new.site.de"). Ask in a Javascript
newsgroup for more information if you want to use Javascript.

In PHP the query-string is available in $_SERVER['QUERY_STRING']. But
the better way would be to use a variable in the query-string
(?site=sitename for example) and read it in PHP using $_GET['site'].
Than you interprete the value (it's risky to use the URL to the site you
want to load, google for "XSS" or "cross site scripting" if you're
interested, so use names for the sites and interprete them in your
script) and print output the HTML-code with the correct path to the site
in the src-attribute of the frame. Ask in a PHP group for more
information ;)

Johannes
 
D

dorayme

I have a page on my site where i would like to insert a link to jump
on another site.

This site is per exemple: http:\\www.foreignsite.com and is a framed
site. The index.html position the frames as; title.htm, menu.htm and
welcome.htm.

Why have you got your slashes back to front, you are not the priest in:

<http://dorayme.890m.com/jokes/priestCollar.html>

Is it because you don't want people clicking to go to what is a real
(unrelated) site?
On the menu there is a link to change the welcome.htm to news.htm

If my link points to http:\\www.foreignsite.com the main frame is
filled with welcome.htm

How to be able to (during the jump) .... fill the main frame with the
news.htm page ?

You do this by preparing a frameset with your title, menu, and news
(instead of welcome) frames. Call it something, does not matter (the url
bar will not show it anyway), eg. newsFrameset.html and fashion the link
in your menu with target="_top":

<a href="catalog/frogs.html" target="_top">news</a>
 
R

Raymond Schmit

Why have you got your slashes back to front, you are not the priest in:

<http://dorayme.890m.com/jokes/priestCollar.html>

Is it because you don't want people clicking to go to what is a real
(unrelated) site?


You do this by preparing a frameset with your title, menu, and news
(instead of welcome) frames. Call it something, does not matter (the url
bar will not show it anyway), eg. newsFrameset.html and fashion the link
in your menu with target="_top":

<a href="catalog/frogs.html" target="_top">news</a>

Sorry for the \\ it's a mistake.
I effectively can mimick the foreignsite by creating the 3 frames and
affecting them per example:
httlp://www.foreignsite.com/index.htm
httlp://www.foreignsite.com/title.htm
httlp://www.foreignsite.com/news.htm (instead of welcome.htm)

This way of doing it, will show the foreignsite as i wish, ok ....
but the navigation will be impossible, because the baseurl is on
mysite and not on the foreignsite.
 
J

Johannes Hafner

Johannes said:
Raymond said:
I have a page on my site where i would like to insert a link to jump
on another site.

This site is per exemple: http:\\www.foreignsite.com and is a framed
site. The index.html position the frames as; title.htm, menu.htm and
welcome.htm.
On the menu there is a link to change the welcome.htm to news.htm

If my link points to http:\\www.foreignsite.com the main frame is
filled with welcome.htm

How to be able to (during the jump) .... fill the main frame with the
news.htm page ?

Use Javascript or (better) any server-side language (if available on
your server) like PHP. You can use the query-string (the thing behind a
? in an URL, bet you've already seen this somewhere) for submitting the
information with the link.

With javascript you can read the query-string (location.search) and
interprete it to load a specific site into the frame
(document.framename.location.href = "new.site.de"). Ask in a Javascript
newsgroup for more information if you want to use Javascript.

In PHP the query-string is available in $_SERVER['QUERY_STRING']. But
the better way would be to use a variable in the query-string
(?site=sitename for example) and read it in PHP using $_GET['site'].
Than you interprete the value (it's risky to use the URL to the site you
want to load, google for "XSS" or "cross site scripting" if you're
interested, so use names for the sites and interprete them in your
script) and print output the HTML-code with the correct path to the site
in the src-attribute of the frame. Ask in a PHP group for more
information ;)

Oops, sorry, I did not realise that it's a foreign site. The PHP is no
possiblit and Javascript only, if you're allowed to load the whole page
into an frame of yours.

Johannes
 
J

Jonathan N. Little

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top