www.webdeveloper.com
Results 1 to 7 of 7

Thread: Help Please

  1. #1
    Join Date
    Feb 2003
    Location
    Aberdeen, Washington, USA
    Posts
    1,859

    Question Help Please

    I have this site The Dandy Group and it has this javascript it automaticly inserts into the top of my page before the <HTML> tag and what the javascript does is displays this popup that pops under the page and then after like 10 seconds it pops over the page. Its the same thing for everyone of my pages and I have lots and lots of pages and I wanted to know if their was a php script out there that would automaticly insert a script at the top of my pages that would disable this popup. I don't want to have to go and insert a script that would do this on every single page so is thier a script that would automaticly do this like a php include or somthing? I'll post the code it inserts in the top of the page below.


    <script language="JavaScript">win155 = window.open('','cons723'); win155.blur();self.focus();var url = "http://" + self.location.host;var file = "/locmntl/hotfreebies.html";if (win155.document.URL.indexOf(url) == -1) { win155.location.href = url + file; }
    </script>


    So I will accept answers from anybody. Please help.
    Last edited by Jick; 04-08-2003 at 02:34 AM.

  2. #2
    Join Date
    Nov 2002
    Location
    NY, USA
    Posts
    731
    You're not going to be able to disable JavaScript pop-ups with PHP or any other server side language. They're being automatically inserted by your host (I'm assuming you don't pay them). And since their added scripting is at the end of your page it can be done. Possibilities: start an HTML comment that you don't close; start a JavaScript comment you don't close; start a JavaScript statement that isn't complete. It'll cause errors on the page but it may stop the pop-ups.

    Or have your own onload event that will automatically close the windows that are opened.
    for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
    {for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";

  3. #3
    Join Date
    May 2003
    Location
    down below
    Posts
    17
    <script language="JavaScript">
    win155 = window.open('','cons723');
    win155.blur();self.focus();
    var url = "http://" + self.location.host;
    var file = "/locmntl/hotfreebies.html";
    if (win155.document.URL.indexOf(url) == -1) { win155.location.href = url + file;
    }
    </script>
    <HTML>
    <HEAD>
    <TITLE>REGG</TITLE>
    </HEAD>
    <BODY OnLoad="window.win155.close()">
    </BODY>
    </HTML>
    there ya go
    javascript is easy as long as you take it for breakfast

  4. #4
    Join Date
    Nov 2002
    Location
    England
    Posts
    693

    Try this

    This is how you would do it in Perl.

    #!/usr/bin/perl -wT

    use CGI qw(:all);
    use CGI qw(fatalsToBrowser);
    use strict;

    print header;

    sub goto_404{
    print<<DOCUMENT
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>404 Page not found</title>
    </head>
    <body>
    Your 404 message here
    </body>
    </html>
    DOCUMENT
    }

    my $js = <<VARIABLE;
    <script language="JavaScript">win155 = window.open('','cons723'); win155.blur();self.focus();var url = "http://" + self.location.host;var file = "/locmntl/hotfreebies.html";if (win155.document.URL.indexOf(url) == -1) { win155.location.href = url + file; }</script><html>
    VARIABLE

    if(defined param('page') && open(FILE, param('page'))){
    my @lines = <FILE>;
    for(my $i=0; $i<scalar(@lines); $i++){
    if(index($lines[$i],$js) <= -1){
    print $lines[$i];
    }
    }
    }else{
    &goto_404;
    }

    All links need to be defined as page.pl?page=blah.html

  5. #5
    Join Date
    Nov 2002
    Location
    NY, USA
    Posts
    731
    This is how you would do it in Perl...
    Do what exactly? This won't even do what the original poster wanted.
    for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
    {for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";

  6. #6
    Join Date
    Nov 2002
    Location
    England
    Posts
    693
    What????????????????????????

    Do you not see the part where it opens the documents, reads the lines and if the line has the js code on it don't print it.....

    If you run a page, for example, index.html through it like so page.pl?page=index.html

    The perl program opens index.html, reads the lines into @lines and then checks to see if line n is the js code.

    ??????????????????

    I don't see what the problem is.

  7. #7
    Join Date
    Nov 2002
    Location
    NY, USA
    Posts
    731
    Server's do not statically modify HTML documents on the server. It is attached to whatever output is being sent to the client. In the case of a Perl script, whatever output it produces will be modified to include the server's script header and then passed to the client.
    for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
    {for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles