Is there a way to retrieve a portion of a page's URL string?
I have academic program pages (for a College and Seminary) that need to offer a link to course offerings based on which arm of the school is offering the course: the college, seminary, or distance ed office. Some courses overlap (are offered by more than one 'arm'), so I am hoping I can retrieve "college", "seminary", or "cde" from the URL, in order to tell certain links where to go.
Here are some link examples so you can see what I'm working with:
Certificate of the Seminary http://briercrest.ca/seminary/programs/study.aspx?id=53&level=2
Certificate of the Seminary (CDE) http://briercrest.ca/cde/programs/study.aspx?id=53&level=2
At the bottom of the program page, there is a link to "View all courses". I'd like to send users to CDE's course listings when they view the program at briercrest.ca/cde, and to seminary course listings when viewing the program page at briercrest.ca/seminary. (This is necessary because CDE and the Seminary don't offer all the same courses.)
That's the problem. To solve it, I'm hoping to be able to extract "cde" or "seminary" from the page URL so that I can tell the "View all courses" link which set of courses to link to.
I know that the whole URL path is accessible using
http://
but is there a way to grab only a specific part of the URL?
I'm not trying to retrieve a parameter passed in the URL. That's easy enough. I'm trying to access a portion of the URL much earlier in the string.
Get portion of URL path
Is there a way to retrieve a portion of a page's URL string?
I have academic program pages (for a College and Seminary) that need to offer a link to course offerings based on which arm of the school is offering the course: the college, seminary, or distance ed office. Some courses overlap (are offered by more than one 'arm'), so I am hoping I can retrieve "college", "seminary", or "cde" from the URL, in order to tell certain links where to go.
Here are some link examples so you can see what I'm working with:
http://briercrest.ca/seminary/programs/study.aspx?id=53&level=2
http://briercrest.ca/cde/programs/study.aspx?id=53&level=2
At the bottom of the program page, there is a link to "View all courses". I'd like to send users to CDE's course listings when they view the program at briercrest.ca/cde, and to seminary course listings when viewing the program page at briercrest.ca/seminary. (This is necessary because CDE and the Seminary don't offer all the same courses.)
That's the problem. To solve it, I'm hoping to be able to extract "cde" or "seminary" from the page URL so that I can tell the "View all courses" link which set of courses to link to.
I know that the whole URL path is accessible using
but is there a way to grab only a specific part of the URL?
I'm not trying to retrieve a parameter passed in the URL. That's easy enough. I'm trying to access a portion of the URL much earlier in the string.
Any clues?
Thanks,
Luke
Sorry for the repeat post. I'm getting parsing errors as I try to submit this post to the forum.
Never mind. I found the solution using:
is working on a reply...