# (Solved) How would I link to a frameset which was pointing to a certain page...



## NameTooLong (Dec 26, 2002)

I want to link to my page

```
[URL]http://webpages.charter.net/biller/drivel/index.htm[/URL]
```
but have the "main" frame inside the frameset point to

```
[URL]http://webpages.charter.net/biller/drivel/setpermissions.htm[/URL]
```
is that possible?

To recap, I want to be able type a URL that points the frameset to a certain page.


----------



## yul (Feb 11, 2003)

would u like to rephrase the question please?


----------



## yul (Feb 11, 2003)

maybe i did understand u r question...then perhaps maybe NOT !

have u tried using


```
target="_top"
```
or

```
target="_parent"
```
instead of _blank that u r using right now?


----------



## NameTooLong (Dec 26, 2002)

I didn't add the a href... the forum did. I want to link from a page, such as this forum to my page. But my page uses frames. I don't want to go to the main page and I don't want to go directly to setpermissions.htm... I want to display it as if you went to my page, clicked on tutorial/set permissions. So that it displays setpermissions.htm inside of the "main" frame.


----------



## yul (Feb 11, 2003)

now u got me confused??!!

tell me how u r pages r set.....and this time attach the code as a text file.


----------



## NameTooLong (Dec 26, 2002)

Click on the Website button at the bottom of my posts, view the source. This is what I'm curious about... OK, to point a link to a certain point on a page you would type

```
<a name='a'>
```
and then go to that point by typing http://domain.com/page.htm#a

I want to go to a page and point one of the frames to another location. I assume it's not possible since I am confusing you.


----------



## yul (Feb 11, 2003)

here's what i got from that page u asked me to click on:


```

```
now tell me what are u planning.



> I assume it's not possible since I am confusing you.


I say...2 heads are better than 1


----------



## NameTooLong (Dec 26, 2002)

OK, let me start over... if I type in this post
http://webpages.charter.net/biller/drivel/index.htm
You would go to my page and the frames would display as follows:

top=top.htm
menu=menu.htm
main=main.htm

But if I typed http://webpages.charter.net/biller/drivel/setpermissions.htm in this post I would only go to the setpermissions page and there would be no other frames. Is there a way to go to http://webpages.charter.net/biller/drivel/index.htm but the frames be displayed as:

top=top.htm
menu=menu.htm
main=setpermissions.htm

The only way I can think of to get set permissions in the main frame is to go to http://webpages.charter.net/biller/drivel/index.htm and click on "Tutorials" then click on "Hoe to set file permissions".


----------



## yul (Feb 11, 2003)

> Is there a way to go to http://webpages.charter.net/biller/drivel/index.htm but the frames be displayed as:
> top=top.htm
> menu=menu.htm
> main=setpermissions.htm


yes u can do that this way:


```

```


----------



## NameTooLong (Dec 26, 2002)

I don't mean like that, I don't want to change the code, I just mean like for example... this is how I would need to use it...

PERSON: How do I set permissions in Windows XP Pro? (or some question that I would have a tutorial for, as soon as I get around to making more)

ME: Go view my tutorial at http://www.domain.com/page.htm

See? If I send them to my index page then they'll have to find their way to the tutorial... and if I send them directly to the tutorial the can't see the frames and therefore can't navigate back to the rest of the page... is there a way to get the best of both worlds without creating a new page? I can change the code to do whatever I want... I mean, I coded it all by hand. But can I link to the setpermissions page from here so that it will show up in a frame. I think I'll give up since no one seems to know what I'm talking about. I guess you have to have the answer to understand the question, maybe there is no answer... oh well, I was just curious. I guess I could just make a new page and do the frames as you suggested so that they will start at the set permissions page and be able to navigate to the other pages and I'd just give the link to that page instead.


----------



## yul (Feb 11, 2003)

Oh i see what u mean (am a bit slow at times)

No ! there is no way u could do that.

what i would suggest is instead of using frames (which I absolutely hate) u could use tables .... that would solve u r problems.


----------



## NameTooLong (Dec 26, 2002)

Sorry, I prefer frames, but thanks for at least taking the time to read through my babble to figure out what I wanted. I figured it wasn't possible but it was worth a shot. You are the only who seems to have attempted answering my question, thanks again.


----------



## Shadow2531 (Apr 30, 2001)

It's not really practical, but what you can do is create another frameset page called permissions.htm

Then in permissions.html load

top=top.htm
menu=menu.htm
main=setpermissions.htm

Then you wouldn't link to setpermissions.htm, but permissions.htm

So every one of your linked pages would have a frameset htm file with top
menu
main. with main being the linked page.

Your top and menu stay the same for every linked page and for every linked page, you would have 2 htm files. The frameset file that you will use to link to and the actual linked page.

It's not really hard to do and I know you'll get it


----------



## Shadow2531 (Apr 30, 2001)

or you could just provide a HOME link on the set permissions page.

or just say

Goto my index page and click on "Tutorials", then "how to set file permissions"

but you knew that already.

You might also be able to do some things with javascript.


----------



## NameTooLong (Dec 26, 2002)

As for making another frameset, I sort of mentioned that in post #10... I thought about a link back to home but I don't know where I would put it, also maybe I could use some sort of javascript that would add the frames to the page... I'll have to look at W3 Schools, I believe I have seen a button like that used on some gaming site, unless it was just a normal link back to the frameset, thanks anyway shadow... I'll come up with something easy, no matter how complicated it is to figure out.


----------



## NameTooLong (Dec 26, 2002)

I just reread my earlier posts and I see why I confused yul, I can't even understand what I said, and I know what I was trying to say. Sorry about that.


----------



## Shadow2531 (Apr 30, 2001)

You can ask your isp if the web page server supports asp, php, or cgi.

Then you can set up a query string to accomplish what you want

Try this and see if you like it. Just look at the actual shortcut to see how it's done.

There's a little bit more to it than that. That example will display nothing for the main if you don't specify the page string, but you see the point.

For your index.htm I replaced the main src with the following


```
<%Response.Write Request.QueryString("page")%>
```
and saved it as an asp file. Then uploaded it to my server.

You would of course use variables to set it up so by default it loads the normal main.htm if you don't specify the page string.

Now as for your isp supporting asp, php, or cgi all you can do is ask. It might cost more.

For my isp, it costs more to use php and cgi or use write functions of asp. However I can use read only functions of asp without paying any more $$.

Maybe your isp will allow you to use asp for free or at least the read only functions.

Attached is a text file to show you what the code looks like.

So you can save as an asp file and upload it to your server to see if it works.


----------



## NameTooLong (Dec 26, 2002)

I saved out the code as asp and uploaded to the server, typed in the address as you did with your link and it said "BAD REQUEST - Server did not understand the request" in the main frame... so I guess I have no asp. I don't know if they charge extra for it or not... their help and support isn't that great, you have to download some ActiveX thing or similar and then chat directly with a techguy. Why can't I just e-mail them


----------



## Shadow2531 (Apr 30, 2001)

ask the webmaster

[email protected]

found the email address commented out in the code of the contact us page.

Just tell them what you want to know/do and see if they respond.

You can claim that the regular contacting method didn't work.

Worth a try.


----------



## NameTooLong (Dec 26, 2002)

I just sent an e-mail and I'll let you know when I get a reply. And good going on searching through the source... why didn't I think of that? Maybe just not as smart as you.


----------



## Shadow2531 (Apr 30, 2001)

nah, I'm just nosier 

Here is the info on your webserver.

The webserver
Apache server running Solaris 8. Most likely going to have cgi and perl support and even php instead of asp. If you can get your home directory cgi enabled for read only functions that would be great.

The site server
Charter.net runs on a IIS server and as you can tell uses asp.

If you can indeed get read only options ofone of them, you can do the same thing with a query string like in the example with asp.

I made another example that works if you don't input the query string. (just for kicks)

main.htm=shockwave.com

query string not specified aka index.htm


----------



## brendandonhu (Jul 8, 2002)

Why aren't we just using this tiny little javascript that will detect if the frame is loaded and if not it will redirect them to the framed page???? LOL.

```

```


----------



## Shadow2531 (Apr 30, 2001)

Are you saying that if you put that script into this page , when that page loads (from that link) it will automatically load index.htm and put that page in the main.htm frame of the index.htm frameset?

So when you load that page, the end result would be this ?

If so, that would do the trick (if javascript was enabled in the browser)


----------



## NameTooLong (Dec 26, 2002)

I added that code to the setpermissions page and opened it... it just loaded the frameset, unless I used it in the wrong way, that's not what I'm wanting. Also, still no reply from the webmaster.


----------



## NameTooLong (Dec 26, 2002)

Shadow, can you give me the code you used for the shockwave example, I noticed it was a server side script so I can't just grab it myself, as far as I know. I think I'll just try the codes instead of waiting for a reply.


----------



## Shadow2531 (Apr 30, 2001)

It's asp.

Haven't tried doing the same with php yet. (I got win2k with IIS with asp, php, cgi and perl all set up so I'll figure it out)

Once I figure it out with php, I post that.

Anyways here is the asp way attached.

to get the shockwave site to load as the main, you add

?main=http://www.shockwave.com to the url of drivel3.asp


----------



## Shadow2531 (Apr 30, 2001)

Save the following attachment as a php file and upload it. Then you will at least know if php works or not.
Then you can get started searching the net for some cool scripts.

If anyone feels like converting the asp code in the attachment drivel3.txt from above to php code, that would be cool. If not, I'll still figure it out.


----------



## NameTooLong (Dec 26, 2002)

I saved the attachment as test.php and uploaded it. I went to http://webpages.charter.net/biller/drivel/test.php and it tries to download the file... does that mean it doesn't work?

EDIT: I originally uploaded it to the wrong directory so it was in images/test.php and that is when it would try to download it, then I removed it and uploaded it into the right directory and now it just shows a white page. Don't know why there is a difference though.


----------



## Shadow2531 (Apr 30, 2001)

Yep that usually means that php files on that server are just considered a regular old file and not a web document.

Maybe your isp will be cool and enabled it. If they respond.

I see. It's still not working though. You would see "this is a php function test" if it was working


----------



## NameTooLong (Dec 26, 2002)

Do you think CGI would be enabled on it, I kind of doubt it though, they don't seem to have anything extra.


----------



## Shadow2531 (Apr 30, 2001)

I really really doubt it, but it can't hurt to try. You have to have cgi-bin access. If it was all setup, I think there would be a cgi-bin folder in the root of your webspace depending how it was setup. Plus the server needs to have perl installed to run the perl scripts. *Generally*, all cgi is, is an html file where you call an external perl script in about the same way you call an external javascript file. On IIS, to use cgi you use the .shtml extension instead of the cgi extension. If you want the cgi extension to work, you have to add the extension and use the same parameters as .shtml.


----------



## Shadow2531 (Apr 30, 2001)

attached is a perl script you can try. (it's not going to work, but you can try)

save as .pl 

It's going to display a bunch of crap on the page. However if for some, weird, funky reason it works, it will display a sentence of text. If it works then you could use perl directly or call it with cgi.

Really your only hope was that php was enabled (at least for read only), but if your ips won't hook you up, then you'll either have to use multiple framesets or consider a different design.

For now though, I would put a link in your setpermissions page that points to your index.htm page.

Specifically in the same cell as Author: eternalDRIVEL. So if you give somebody the link to that page, they can at least easily get to your index page.


----------



## NameTooLong (Dec 26, 2002)

It just displayed a bunch of crap. Still no reply from Charter. I guess I'll just post a link to the page and tell them where they should go depending on what they need.


----------



## brendandonhu (Jul 8, 2002)

The JS really should work.
Heres the original source of it
http://javascript.internet.com/navigation/force-frames.html

If it still doesn't work for you, your probably not doing it correctly. Maybe I will test it myself.


----------



## NameTooLong (Dec 26, 2002)

Once again I pasted 

```

```
into the head of my setpermission.htm and then opened it... it then redirected me to my original index.htm with all of the frames the same as if I just opened up index.htm... the code works fine it's just not doing what I need, how hard is it to paste code into the head of a page. I'm not that stupid, it's just the wrong code. Thanks for trying though.


----------



## NameTooLong (Dec 26, 2002)

I just read the description of the code and now I understand what it's purpose is... if someone just typed in setpermissions.htm they would go to that page and only see that what's on that page, but if you put that code into the head of your pages that are meant to be viewed inside of a frame then it will redirect them to the frameset and then they have to navigate to all the pages. It will not change any of the frames like I have been trying to do.


----------



## Shadow2531 (Apr 30, 2001)

Got the same result with the script. Just takes you back to the index.htm.

As you said, the script works fine, but doesn't do the trick, but I have an idea on an external javascript file that you can use on all your linked pages to basically docwrite the page into a frameset.

I'll Give it a shot tonight.

L8R.


----------



## NameTooLong (Dec 26, 2002)

Would it be possible, with Javascript, to look for certain referrers, such as setpermissions.htm, and then redirect the main frame to the corresponding page?

The setpermissions.htm page would have the code brendan provided and so that it redirects to the frameset and the then the main frame redirects to the page set for the referrer. Or am I just dreaming?

EDIT: where did your post come from Shadow? I kinda just repeated what you said, but a little differently.


----------



## Shadow2531 (Apr 30, 2001)

here you go

http://tech.irt.org/articles/js013/

that is suppose to be how you do it.

it's like using a query string with javascript.

You have to use javascript to document write your frameset code in your index.htm page to allow the search variable. You set up 2 conditions if ?main is there, then the setpermissions page should load in main. if it isn't then you set the default.

Then you can use brendandonhu's script as in external script that you call from each page you want.

The only difference is you add ?main to the index.htm url in that script. (since your main.htm frame has the name attribute set as "main"

It should work. (if javascript is enabled in the visitor's browser)

So yes brendandonhu we can make the script work (with the ?main part) I think. Thanks.


----------



## NameTooLong (Dec 26, 2002)

I'm having trouble implementing the code into my index page... here is my exact source after adding the code:

```
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Frameset//EN'>

  WHAT A BUNCH OF DRIVEL

      [CENTER]Your browser is unable to view this site.  Try the latest version of [URL=http://www.microsoft.com/windows/ie/]Internet Explorer[/URL].[/CENTER]
```
I uploaded it to my server, because they said it won't work offline, but when I go to the page, the main frame is blank and I get an error from IE that says:

Line: 19
Char: 1
Error: Function expected
Code: 0
URL: http://webpages.charter.net/biller/drivel/

The redirection code they supplied works fine but am I missing something in the frameset code?


----------



## Shadow2531 (Apr 30, 2001)

Ok, I'm on it.


----------



## Shadow2531 (Apr 30, 2001)

I fixed the code.

Now you will see why I suggested using quotatation marks for attributes.

On another note, the name attribute value for the main frame has no effect on the new script. I left the value at display, but it should be set back to main to maybe help your menu link(javascript) work with the new script stuff.


----------



## Shadow2531 (Apr 30, 2001)

Here is the code that you either put in your setpermissions page or call it externally.

I would save that as redirect.js and call it into your setpermissions page.

The string after the question mark has to be the filename of the page, without the .htm part.

The whole setup works for 2 frames, but for your 3 frame setup, it's not working right, when you try to load setpermissions.htm directly. It should go into the main frame of index.htm, but it just gets caught in a loop. A problem because there are 3 frames and the script was ment for 2.

However, it should be possible to do it with 3 frames, just more complicated than it already is.

I sent you an email with 2 attachments with the scripts all set up. You'll have to figure out how to get it to work with 3 frames though.


----------



## NameTooLong (Dec 26, 2002)

YAY! I finally got it to work. The problem was the navigation frame all along, mine is called "menu" and the script was written using the name "nav" instead.

```

```
Also, the URL you would use to get setpermissions.htm into the main frame is not setpermissions.htm?main but actually index.htm?setpermissions. Thanks to all who tried helping me. I have completely set up all of the pages and uploaded them.

BTW: To get the menu to display properly I had to use href='index.htm?tutorials' target='_top'.


----------



## Shadow2531 (Apr 30, 2001)

oops, I should I seen that. I'm glad you got it though, it was buggin me.

I just sent you an email with another idea before I checked your post, but check it out anyways.


----------



## Shadow2531 (Apr 30, 2001)

You actually did it a little better than the author of the script intended.

Instead of linking to setpermissions.htm and using the script to force it in the frame, you left setpermissions alone. Then as you know link to it like

http://webpages.charter.net/biller/drivel/index.htm?setpermissions

basically the same way as the query string for asp only without the .htm part because that gets added by the script.

You can still load other sites into your main frame, just as long as it's an htm file

like this

also did you purposely mean to put ?contact inside your main.htm? If you link directly to your main.htm it loads the contact page in the main frame. Just letting you know just in case you didn't do that on purpose. Changing it to ?main will fix that.

And if you wanted to add the script to setpermissions.htm, so you can link to it directly without using the query string, this works, which you probably figured.


```

```


----------



## NameTooLong (Dec 26, 2002)

Thanks a lot for pointing out those two things, I didn't mean to do that. I was up until 6 in the morning so I had a feeling that I was going to mess up something... I'm still surprised I caught that whole nav/menu thing. I did it by slowly changing the test.htm into the index.htm and everytime I changed the menu frame code the page would get stuck in an endless redirection loop until IE crashed. When I finally narrowed it down to the frame name I went over the redirection code over and over until I saw where it was referring to nav. I just hope I didn't mess up anything else while I was trying to solve that problem.


----------



## NameTooLong (Dec 26, 2002)

Speaking of mistakes, I just found one more... the top.htm was not redirecting to the index.htm because it was missing a *(* in the code, fixed that and now everything is working.


----------



## Shadow2531 (Apr 30, 2001)

Cool. You'll probably find a few more, but it looks good and of course it's virtually html compliant.

Now you just need to add 30 more frames!


----------



## NameTooLong (Dec 26, 2002)

EDIT: I decided to make a thread for this extra question instead... go here to read it: http://forums.techguy.org/showthread.php?s=&threadid=127748


----------



## NameTooLong (Dec 26, 2002)

You know... after all this time and hard work (OK,OK, Shadow's hard work), Charter's webmaster never did bother replying to my message.


----------



## brendandonhu (Jul 8, 2002)

I'm not surprised, its a webmaster adddress pulled out of their source code, not a tech support address.


----------



## NameTooLong (Dec 26, 2002)

Yeah but it was worth a try, I would complain about their lack of contact information but I'm not downloading 3rd party software just to speak with them.


----------



## Shadow2531 (Apr 30, 2001)

I got a hold of them *being nosey again *

They said they do not have any of the following command interpreters installed on the server. Since they are not even installed, you can't even pay to get them.

php
asp
perl
c
cgi and shtml extensions

None. Just plain web page support.

the email address is [email protected]

In the subject put *other/request*

In the message, you direct your questions towards "Troy L"

And customer support # is 1-866-311-6648

So if you need to contact them for something, you got the info.

if they don't answer, in the subject,

add [#some 6 or 7 digit number] after the word "request"

if that doesn work use

Other / Request[#983163] for the subject


----------



## NameTooLong (Dec 26, 2002)

Thanks for checking and I'll try and keep that contact info for later use.


----------

