How to resize screen to fullsize in php

by faraox
6 replies
Hi there,

I need some help with resizing my offer urls to full screen.

I'm doing PPV marketing and i don't want to have my offer in a 800px by 600px window. because it will hurt my conversions.

Now I'm using a php redirect to redirect people to the right offer with the following code:

<?php

header( 'Location: myofferurl.com' ) ;

?>

and i added a full screen javascript code below the php code:

<script language="JavaScript1.2">
var myWidth = screen.width;
var myHeight = screen.height;

top.resizeTo(myWidth, myHeight);
top.moveTo(0,0);
</script>

But unfortunately this does not open a new window in full screen.

so i hope somebody can show me how this can be done the right way.

Thanks for your help.
#fullsize #php #resize #screen
  • Profile picture of the author wayfarer
    That behavior might work in some browsers, but not others (I don't remember which). It's disabled these days because such aggressive behavior is detrimental to users.

    If you open a popup (popups will open in response to a click in all major browsers), you can size it however you want.
    Signature
    I build web things, server things. I help build the startup Veenome. | Remote Programming Jobs
    {{ DiscussionBoard.errors[8285428].message }}
    • Profile picture of the author faraox
      Originally Posted by wayfarer View Post

      That behavior might work in some browsers, but not others (I don't remember which). It's disabled these days because such aggressive behavior is detrimental to users.

      If you open a popup (popups will open in response to a click in all major browsers), you can size it however you want.
      Yes, i realize that my popups will open in response to a click. but thats not what i want.

      i need to have my redirection url open in an new window at full size.
      i also tried this script:

      <script language="JavaScript">
      window.onload = maxWindow;

      function maxWindow()
      {
      window.moveTo(0,0);


      if (document.all)
      {
      top.window.resizeTo(screen.availWidth,screen.avail Height);
      }

      else if (document.layers||document.getElementById)
      {
      if (top.window.outerHeight<screen.availHeight||top.wi ndow.outerWidth<screen.availWidth)
      {
      top.window.outerHeight = screen.availHeight;
      top.window.outerWidth = screen.availWidth;
      }
      }
      }
      </script>

      but this also seems not to work.
      {{ DiscussionBoard.errors[8285570].message }}
      • Profile picture of the author wayfarer
        Originally Posted by faraox View Post

        i need to have my redirection url open in an new window at full size.
        Need is a very strong word, especially when you're talking about a behavior that is actually blocked by browsers. You need to start thinking in terms of working around the limitations of your platform (the browser), by coming up with alternative solutions. As far as I know, the resizeTo() method ONLY works on pop up windows anyway, at least across all browsers. So you can spend the next week or so trying to make this work, or you can do something else, like open a popup to your redirected location. This behavior is blocked for a good reason, though it used to be possible in at least some browsers that I remember.
        Signature
        I build web things, server things. I help build the startup Veenome. | Remote Programming Jobs
        {{ DiscussionBoard.errors[8286095].message }}
        • Profile picture of the author faraox
          Yeah, i think i'll go with open a popup. thanks anyway for your help. i really appreciate it.
          {{ DiscussionBoard.errors[8300186].message }}
          • Profile picture of the author reddys
            PHP Code:
            <script type="text/javascript"> <!-- function popup(url)  {  params  'width='+screen.width;  params += ', height='+screen.height;  params += ', top=0, left=0'  params += ', fullscreen=yes';   newwin=window.open(url,'windowname4'params);  if (window.focus) {newwin.focus()}  return false; } // --> </script>  <a href="javascript: void(0)"     onclick="popup('enter url here')">nameeee</a> 
            once try this...
            Signature
            For those who are searching for Direct mobile CPI offers please contact me at skype: madi.webz
            {{ DiscussionBoard.errors[8797884].message }}
            • Profile picture of the author faraox
              Hi reddys.

              Can i use this script to resize a page upon loading? or will it only resize when somebody clicks on it? also, can i use this script together with your popover script you posted earlier?

              if yes, in which order do i have to place this code.

              so what i basicly want to accomplish is that my page become an popover in a full size screen.

              Thanks for your help.
              {{ DiscussionBoard.errors[8797970].message }}

Trending Topics