How to force a frame upon server upload

Discussion in 'JavaScript' started by NewComputer, Apr 2, 2006.

  1. #1
    I am beginning to offer free website hosting, and as part of the free hosting there will be an advertising banner across the top of the page (probably through a frame of some sort). What is the best way to force this sort of thing to all pages uploaded through FTP etc... Just a simple 100 high frame with some advertising in it.
     
    NewComputer, Apr 2, 2006 IP
  2. Slapyo

    Slapyo Well-Known Member

    Messages:
    266
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #2
    Not sure on how to do that, but it would be very easy for the user to write javascript to break the frames. :/

    You might want to look into another way of doing it. Maybe by inserting a javascript into the pages which would create a DIV for the ads.
     
    Slapyo, Apr 3, 2006 IP
  3. NewComputer

    NewComputer Well-Known Member

    Messages:
    2,021
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    188
    #3
    I was thinking of writing some code that had to be inserted into the pages and then a script that would randomly check that it was included in the pages. I may have bitten off more that I can chew :)
     
    NewComputer, Apr 3, 2006 IP
  4. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You could just search each file for the <body> tag and insert your div or table with the ads right into the html output. I don't know what the server hit for this would be, as it would mean parsing each and every file, every time it was displayed. OR only allow your users to edit their files online, and when the file is saved, it adds the code.

    The downside is that an astute user could write javascript to hide your div on page load.

    If you still want to go with a frame, look at other free hosting providers and see what code they insert to do it. :cool:
     
    exam, Apr 3, 2006 IP