I need help

They have: 14 posts

Joined: Jun 1999

Hi,

I am wanting to start a network at my site. I am not sure what computer language it would be best written in, but I am assuming cgi. What I want to do is have a pulldown menu on all the sites that are in the network. I want to beable to easily add sites to the network and have it update all the pulldown menu on all the other network sites. I am sure this is possible, could someone tell me where I could get a script that would be able to do this?

Thanks!

Chris Roane

Web Site Resource - http://www.wsresource.com/

They have: 122 posts

Joined: Jun 2000

CGI isn't a programming language, it's the Common Gateway Interface. Allows interaction between users and servers in a fuller way. CGI scripts can be programmed in pretty much any programming language, as in Perl, C, C++, Basic, and others. You might want to take a look at http://www.cgi-resources.com for a script that fills your requirements.

Rob Radez
OSInvestor.com

They have: 850 posts

Joined: Jul 1999

Seems like an interesting script you need. I will try and work on one when I get some time. Can't promise I can do it though so keep looking.

------------------
Due to precipitation, for a few weeks K2 is bigger than Mount Everest.

They have: 850 posts

Joined: Jul 1999

OK, came up with a script. Hope it suits your needs.

Each site that is part of the network just places:
<script src="url.com/to/dropdown.cgi"></script>

You can view a test of the script at http://dlo.net/~rob/cgi-bin/dropdown.shtml

You can see how the links are stored in the text file at http://dlo.net/~rob/cgi-bin/links.txt

And you can download the source at http://dlo.net/~rob/cgi-bin/dropdown.zip

Hope that helps

------------------
Due to precipitation, for a few weeks K2 is bigger than Mount Everest.

[This message has been edited by robp (edited 12 February 2000).]

They have: 14 posts

Joined: Jun 1999

Hi,

Thank you so much Robp. I really appreciate the time you have spent to do this. I have one question though. Would this script work with like links too?

Thanks!

Chris Roane

They have: 850 posts

Joined: Jul 1999

code:

#!/usr/bin/perl
#To execute this from a site just use
#<script src="http://url.com/to/name_of_script.cgi"></script>
$name_of_file = "links.txt";
$num=0;
$counter=0;
open(IN,"<$name_of_file");
while(<IN> )
{
	$line=$_;
	($name,$url)=split(/<>/,$line);
	$url =~s/\n//g;
	$name =~s/\n//g;
	push(@names,$name);
	push(@urls,$url);
	$counter++;	
}
close(IN);

foreach $url (@urls)
{
	$site = "<a href=\"$urls[$num]\">$names[$num]<\/a>";
	push(@sites,$site);
	$num++;
}
print "Content-type:text/html\n\n";
print "document.write(\'";

foreach $site (@sites)
{
	print $site;
}
print "\');";
[/code]

That should work, I tested it and it worked fine.

------------------
Due to precipitation, for a few weeks K2 is bigger than Mount Everest. 

They have: 850 posts

Joined: Jul 1999

I thought Patrick would have installed Stefen's [ CODE ] hack by now? It has been a few months since the first request for it to be put back on? It shouldn't take more than 5 minutes....

------------------
Due to precipitation, for a few weeks K2 is bigger than Mount Everest.

They have: 14 posts

Joined: Jun 1999

Hi,

Thanks for all your help!

My network is all setup. You can go check it out at http://www.wsresource.com/network/index.html

Thanks!

Chris Roane

They have: 14 posts

Joined: Jun 1999

Hi,

That script that you created for me, does not show up at all in Netscape. Is there a way you could make it compatible with both browsers?

Thanks!

Chris Roane

They have: 850 posts

Joined: Jul 1999

Oops, a dumb mistake of mine. I left a few lines of code that were being printed that shouldn't have been.

The source for the updated version is at http://www.dlo.net/~rob/cgi-bin/dropdown.txt

I tested it on my version of netscape and it worked fine.

------------------
Windmills always turn counter-clockwise. Except for the windmills in Ireland.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.