How to code multiple links to similar a page?

This is a discussion on "How to code multiple links to similar a page?" within the JavaScript Forum section. This forum, and the thread "How to code multiple links to similar a page? are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Jun 19th, 2008, 10:19
Junior Member
Join Date: May 2008
Location: Ireland
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
How to code multiple links to similar a page?

Hi folks,
I've got what I think is a relatively simple problem;

I have a ul with multiple li links that I want to point to a page with an iframe. The only difference between each is the destination iframe url. What is the best way to code this? I have a total of 16 li links and would prefer not to have a webpage for each.


http://www.bjmarine.net/newsite/index.html shows a set of 4 li in a ul on the left hand side under featured boats which currently each link to a different page with an iframe. This is an example of what I want to streamline.

I am familiar with Java and C#, but it's been a while and would really like some help.

Thanks for your input in advance!
Denis
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jun 19th, 2008, 16:41
Aso's Avatar
Aso Aso is offline
Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,344
Blog Entries: 2
Thanks: 11
Thanked 50 Times in 47 Posts
Re: How to code multiple links to similar a page?

You could do this with JavaScript, but if you have a server side language such as PHP enabled, this would be a more rock-solid alternative

Create a file boats.php (you can of course call it anything you like, this is just for demo purposes).

In boats.php, type;
PHP: Select all

<?php
if ( $_GET['src'] ) { // check if 'src' parameter is set

    
$src $_GET['src']; // assign variable
    
    
echo '<iframe src="' $src '" width="100%" height="100%"></iframe>'// print out HTML

} else {
    
    echo 
'No content specified'// alternative content if user reached page with parameter

}
?>
Then you simply structure your links like so;
HTML: Select all
<a href="path/to/boats.php?src=http://iframesource.com">Link Content</a>
HTH
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Prevent multiple instances of web page duncanwill JavaScript Forum 2 May 21st, 2008 08:16
How can I run multiple Double Combobox scripts on the same page? RachVG JavaScript Forum 0 May 15th, 2008 09:06
getting source code of a page mikedikta JavaScript Forum 2 Oct 14th, 2007 18:39
How do i Multiple AJAX Calls on the Same Page ? jd2007 JavaScript Forum 2 Aug 9th, 2007 09:59
Help please with multiple audio on page jwylot Starting Out 7 Mar 12th, 2007 04:01


All times are GMT. The time now is 04:54.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved