Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Drop down box that uses a remote text file?
Old 03-15-2009, 12:17 PM Drop down box that uses a remote text file?
Skilled Talker

Posts: 72
Trades: -2
Does anyone know if it is possible to make a simple html drop box menu that instead of displaying links that are written right into the code, it would get the link information from a text file hosted on another server?

Here's my issue. I'm running a "network" of websites who all include a drop box with links to each of the other network members. The problem is that from time to time a new website comes into the network, and it's such a pain having to go around and change each site's drop box code separately. What I'd rather do is to have each of the site's drop box code "sucking" the information from one singular text file that I'd have hosted on my main site, then I'd only have to update the one file, and it would change all of the drop boxes..

Is this possible?

Here's an example of one of the sites http://mmaa4u.com, the drop box is on the upper right..
ryangassxx is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-15-2009, 04:06 PM Re: Drop down box that uses a remote text file?
racer x's Avatar
Ultra Talker

Posts: 457
Name: Randy
Location: Northern Wisconsin
Trades: 0
Maybe this would work?
http://think2loud.com/using-jquery-a...drop-down-box/
racer x is offline
Reply With Quote
View Public Profile Visit racer x's homepage!
 
Old 03-15-2009, 06:37 PM Re: Drop down box that uses a remote text file?
stevej's Avatar
Professional Multitasker

Posts: 996
Location: Not positive
Trades: 0
Oh yes, it's certainly possible. What racer_x just posted would work, though I'm guessing you probably don't want anything like jQuery or XML. So as far as I know, there are two ways to do this:

1. Use a PHP include. The only problem is that you would need to change your file name from index.html to index.php. Your server would also have to support PHP, but that probably isn't an issue seeing that almost all servers do.

2. Use a server-side include, otherwise known as an SSI. This would probably work better in your case, seeing that it would probably be a lot of work to change all of your page's extensions to .php, as well as the links inside them.
However, some web servers require that you name your file .shtml rather than .html in order to enable the parsing of your file by the server. If server side includes don't appear to work, try renaming the page with a .shtml file extension.

Either option that you choose, your text file will probably end up looking like this:
Code:
<div id="partners">
<form name="form1">
<select style="font-size:10px;color:#006699;font-family:verdana;background-color:#ffffff;" name="menu" onChange="location=document.form1.menu.options[document.form1.menu.selectedIndex].value;">
<option value=''>Please choose</option>
<option value="http://adrynylyn.com">ADRYNYLYN</option>
<option value="http://mmaa4u.com">Modern Martial Arts</option>
<option value="http://teamfearnone.adrynylyn.com">Team Fear None</option>
</select>
</form>

</div>
- Steve
__________________
if($stevej == "helpful") { $talkupation += $user_power; }

Last edited by stevej; 03-15-2009 at 11:14 PM..
stevej is offline
Reply With Quote
View Public Profile
 
Old 03-15-2009, 09:49 PM Re: Drop down box that uses a remote text file?
moatist's Avatar
Skilled Talker

Posts: 64
Trades: 0
PHP is defininitely the way to go.

You could also enable parsing of PHP in .htm, .html files by editing your .htaccess file. Just add the following code to your .htaccess file (usually located at the root of your server):

Code:
//For .html
AddType application/x-httpd-php .html 

//For .htm
AddType application/x-httpd-php .htm
Just a friendly note: unless your dropdown-menu is just linking to external websites, it would be a good idea to use absolute links (i.e. http://website.com/page.html vs. page.html). This is especially an important factor if you are working with large websites.

-Moatist
__________________
Think in code; Dream in digital.

<?php if($helpfull == true){ $talkupation++; } ?>

Last edited by moatist; 03-15-2009 at 10:21 PM..
moatist is offline
Reply With Quote
View Public Profile
 
Old 03-15-2009, 10:01 PM Re: Drop down box that uses a remote text file?
racer x's Avatar
Ultra Talker

Posts: 457
Name: Randy
Location: Northern Wisconsin
Trades: 0
Good point guys. I was trying to think of a way similar to how the Twitter widget(for example) populates a list from an external website with javascript.

BTW - ryangassxx, I forgot that ajax won't include for external sites I think, sorry about that.
racer x is offline
Reply With Quote
View Public Profile Visit racer x's homepage!
 
Old 03-16-2009, 01:11 PM Re: Drop down box that uses a remote text file?
thefandango's Avatar
Extreme Talker

Posts: 215
Trades: 0
Just use an SSI call in the box to one external file containing the links.
__________________

Please login or register to view this content. Registration is FREE

thefandango is offline
Reply With Quote
View Public Profile
 
Old 03-17-2009, 12:11 AM Re: Drop down box that uses a remote text file?
ItzPaul's Avatar
Skilled Talker

Posts: 54
Name: Paul
Location: Bay Area, California
Trades: 0
Nice job. Looks like you got it taken care of, I think.

I'd recommend using PHP and using the full URL http://www. and not just page.php/.html.

You would have to upload the php file you are including to each website unless you can just include the http://www. full url. I can't remember if you can or not I forget. I think you can't but I'm not positive.
__________________
My
Please login or register to view this content. Registration is FREE
- Real Case Study Blog
ItzPaul is offline
Reply With Quote
View Public Profile Visit ItzPaul's homepage!
 
Reply     « Reply to Drop down box that uses a remote text file?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.47032 seconds with 12 queries