Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
  1. #1
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    Best method for this? Preferably php of course.. I need it eventually in a db.
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Can't be done via PHP, only a client-side language like Javascript.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    Is there any way I can have javascript submit a hidden form of it's own? Like I know I could have it detect it and immediately refresh with the information in a form/query string... but is there a way I can just have javascrpt do that without having the client refresh?
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  5. #4
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    what do you mean, explain further please, i may be able to help...

    also what reason do you need the user resolution for?
    JR

  6. #5
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    I'm just building a stats program An involved php/mysql counter. Screen resolution would be probably my biggest curiousity.

    Basically... I need the best way to eventually get the user's resolution to a php script.
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  7. #6
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    well this is how to get it displayed on the page...

    Code:
    <html>
    <head>
    <title>Untitled Document</title>
    <script type="text/javascript">
    function grabreso() {
    swidth = screen.width;
    sheight = screen.height;
    document.getElementById('reso').innerHTML = swidth + 'x' + sheight;
    }
    </script>
    </head>
    
    <body onLoad="grabreso()">
    <span id="reso"></span>
    </body>
    </html>
    JR

  8. #7
    Senior Member skrlin's Avatar
    Join Date
    Apr 2003
    Location
    Illinois
    Posts
    562
    Member #
    1063
    Try something like this:
    Code:
    <body>
    <script type="text/javascript">
    resHgt = screen.height;
    resWth = screen.width;
    document.write('<form action="statsCollector.php" id="resForm" method="GET">');
    document.write('<input type="hidden" name="resoHeight" value="' + resHgt + '">');
    document.write('<input type="hidden" name="resoWidth" value="' + resWth + '">');
    document.write('</form>');
    document.getElementById('resForm').submit();
    </script>
    </body>
    Test link: http://www.skrlin.com/Testing/new/form.htm
    - Brian

  9. #8
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    The object is Screen, not screen. Remember that JavaScript is case sensitive. This will break Netscape, which follows the rules :-P

  10. #9
    Senior Member skrlin's Avatar
    Join Date
    Apr 2003
    Location
    Illinois
    Posts
    562
    Member #
    1063
    I just tested in IE6 NS7 and Moz 1.4, it worked for all...

    I think you have it backwards... http://devedge.netscape.com/library/...ce/screen.html Netscape (which follows the rules ) says so.
    - Brian

  11. #10
    Senior Member skrlin's Avatar
    Join Date
    Apr 2003
    Location
    Illinois
    Posts
    562
    Member #
    1063
    I got a bit interested in what you're trying to do, and I played around a bit. Check out what I came up with: http://skrlin.com/Testing/new/userData.htm
    - Brian


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:49 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com