Still don't think I'm grasping HTML well....

Harsky

Madmin
OP
Member
Joined
Aug 2, 2004
Messages
5,562
Trophies
1
XP
3,851
Country
United Kingdom
I have a site (can't give link, sorry) and when I was organizing the files, I decided to create some folders (such as picture etc) to make it more managable. But I noticed that if I type in something like www.nameofsite.com/picture it gives a full list of every single thing that I uploaded in the picture folder. How do I stop that happening?
 

jumpman17

He's a semi-aquatic egg laying mammal of action!
Former Staff
Joined
Apr 11, 2003
Messages
9,109
Trophies
2
Age
37
Website
Visit site
XP
3,535
Country
United States
put a blank html file called index.html into the folder. then when you try to go to that folder, it will show a blank page. or you could type something up if you want saying "ZOMG! Super secret haxxors page!"

There is another way to block all folders but I don't know how.
 

Harsky

Madmin
OP
Member
Joined
Aug 2, 2004
Messages
5,562
Trophies
1
XP
3,851
Country
United Kingdom
Don't want to make another topic so I'll post here. There's something I'm trying to do on my site. I made several pictures to use as the banner on top of my site. Only problem is, I can't settle on one picture. So what I was wanting to do is that everytime someone refreshes the site, the picture always changes. Unfortunately, I was told that can only be done in Javascript and I don't know the first thing to do. Thanks in advance.
 

mthrnite

So it goes.
Former Staff
Joined
Jun 30, 2006
Messages
4,567
Trophies
3
Age
60
Location
th' south
Website
www.facebook.com
XP
2,854
Country
United States
rofl2.gif
^^^

Whew!

Well, here, do what I do, find a site that has what you want, and swipe the code. Monkey around switching out the graphics and whatnot until it works. That's how I learned HTML.
wink.gif
 

Samutz

Well-Known Member
Member
Joined
Oct 4, 2004
Messages
1,598
Trophies
1
Website
samutz.com
XP
373
Country
United States
http://www.aunder.org/
Type refresh and the banner at the top changes...
Is that what you were looking for?

Their's is done with php most likely (as most of their site is run by php).

QUOTE(Harsky @ Sep 17 2006, 07:38 AM)Unfortunately, I was told that can only be done in Javascript and I don't know the first thing to do. Thanks in advance.
Well not solely Javascript only, but it can't be done with standard HTML. Like the above example, it can also be done with php. If you want to go that route, I could whip up a quick script that would work for you.
 

SomeGuyGG

Well-Known Member
Member
Joined
Jun 28, 2004
Messages
251
Trophies
0
Location
canada
XP
162
Country
Canada
Put this in the header, to add more just copy the banner[*] line, change the number to 1 above the last, and then change the numbanner to match [remember [0] counts as 1 too].

CODE
    function getbanner() {
            banner = new MakeArray(100);
            numbanner = 4;  // Make this the number of banners you have.

            banner[0] = ""
            banner[1] = ""
            banner[2] = ""
            banner[3] = ""
           //Make more as needed

            var now = new Date()
            var sec = now.getSeconds()

            return banner[sec % numbanner];
    }

    function MakeArray(n) {
            this.length = n;
            for (var i = 1; i
 

Psyfira

Credit: 0ml. Insert tea to continue
Member
Joined
Dec 31, 2003
Messages
3,886
Trophies
0
Location
England
XP
270
Country
It's working fine over here (assuming you've changed the image URL's cause the ones in the example don't exist)
 

Harsky

Madmin
OP
Member
Joined
Aug 2, 2004
Messages
5,562
Trophies
1
XP
3,851
Country
United Kingdom
Okay, I made up the banner, inserted the script between the head but when I try to put this where I want it to appear:


CODE
  document.write(getbanner());
 Â

It doesn't work
 

Qith

Well-Known Member
Member
Joined
Jan 20, 2004
Messages
203
Trophies
0
Age
38
Website
Visit site
XP
216
Country
Netherlands
Okay so your code should look something like this:

CODE

pr0n


 Âfunction getbanner() {
     Âbanner = new MakeArray(100);
     Ânumbanner = 4; Â// Make this the number of banners you have.

     Âbanner[0] = ""
     Âbanner[1] = ""
     Âbanner[2] = ""
     Âbanner[3] = ""
     //Make more as needed

     Âvar now = new Date()
     Âvar sec = now.getSeconds()

     Âreturn banner[sec % numbanner];
 Â}

 Âfunction MakeArray(n) {
     Âthis.length = n;
     Âfor (var i = 1; i
 

Harsky

Madmin
OP
Member
Joined
Aug 2, 2004
Messages
5,562
Trophies
1
XP
3,851
Country
United Kingdom
Yay, got it working. But what about the alcohol...... BTW, I found myself using quite a lot of banners which is making the code looking a little messy. Is there another banner refreshing option?
 

Squiffy

GBATemp's Little Embarrassment
Member
Joined
Oct 30, 2002
Messages
1,192
Trophies
2
Age
22
Location
Northern Ireland
Website
pyon.co.uk
XP
438
Country
Well, we won't actually see the code, and since it's only text the filesize should still be small. So, I wouldn't worry about it getting messy, just tab it out, add new lines to make it neater.
Have you ever seen the gbatemp portal source? It's horrible!
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • BigOnYa @ BigOnYa:
    Biomutant looks cool tho, may have to try that
  • Quincy @ Quincy:
    Usually when such a big title leaks the Temp will be the first to report about it (going off of historical reports here, Pokemon SV being the latest one I can recall seeing pop up here)
  • K3Nv2 @ K3Nv2:
    I still like how a freaking mp3 file hacks webos all that security defeated by text yet again
  • BigOnYa @ BigOnYa:
    They have simulators for everything nowdays, cray cray. How about a sim that shows you playing the Switch.
  • K3Nv2 @ K3Nv2:
    That's called yuzu
    +1
  • BigOnYa @ BigOnYa:
    I want a 120hz 4k tv but crazy how more expensive the 120hz over the 60hz are. Or even more crazy is the price of 8k's.
  • K3Nv2 @ K3Nv2:
    No real point since movies are 30fps
  • BigOnYa @ BigOnYa:
    Not a big movie buff, more of a gamer tbh. And Series X is 120hz 8k ready, but yea only 120hz 4k games out right now, but thinking of in the future.
  • K3Nv2 @ K3Nv2:
    Mostly why you never see TV manufacturers going post 60hz
  • BigOnYa @ BigOnYa:
    I only watch tv when i goto bed, it puts me to sleep, and I have a nas drive filled w my fav shows so i can watch them in order, commercial free. I usually watch Married w Children, or South Park
  • K3Nv2 @ K3Nv2:
    Stremio ruined my need for nas
  • BigOnYa @ BigOnYa:
    I stream from Nas to firestick, one on every tv, and use Kodi. I'm happy w it, plays everything. (I pirate/torrent shows/movies on pc, and put on nas)
  • K3Nv2 @ K3Nv2:
    Kodi repost are still pretty popular
  • BigOnYa @ BigOnYa:
    What the hell is Kodi reposts? what do you mean, or "Wut?" -xdqwerty
  • K3Nv2 @ K3Nv2:
    Google them basically web crawlers to movie sites
  • BigOnYa @ BigOnYa:
    oh you mean the 3rd party apps on Kodi, yea i know what you mean, yea there are still a few cool ones, in fact watched the new planet of the apes movie other night w wifey thru one, was good pic surprisingly, not a cam
  • BigOnYa @ BigOnYa:
    Damn, only $2.06 and free shipping. Gotta cost more for them to ship than $2.06
  • BigOnYa @ BigOnYa:
    I got my Dad a firestick for Xmas and showed him those 3rd party sites on Kodi, he loves it, all he watches anymore. He said he has got 3 letters from AT&T already about pirating, but he says f them, let them shut my internet off (He wants out of his AT&T contract anyways)
  • K3Nv2 @ K3Nv2:
    That's where stremio comes to play never got a letter about it
  • BigOnYa @ BigOnYa:
    I just use a VPN, even give him my login and password so can use it also, and he refuses, he's funny.
  • BigOnYa @ BigOnYa:
    I had to find and get him an old style flip phone even without text, cause thats what he wanted. No text, no internet, only phone calls. Old, old school.
    K3Nv2 @ K3Nv2: @BigOnYa...