Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9125779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:52:58+00:00 2026-06-17T06:52:58+00:00

The following is one file index.php GetWidth and GetHeight functions work. (They are not

  • 0

The following is one file index.php GetWidth and GetHeight functions work. (They are not final functions so not important.) The important part is marked by /* IMPORTANT HERE */ What I am trying to accomplish is pass the variable I get using jQuery Window Portal Height / Width and pass it to a PHP script here In other words when I get value from GetWidth() it should go to w=120 or replace 120 value with whatever the width is at the moment and the same with height. If there is any syntax errors please ignore.

I only want to figure out how to pass value from jQuery to PHP scrip. Also in the future I want add on resize method so values will be dynamic when window is resized.

<html>
    <head>
        <title></title>
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
        <script>
            $(window).resize(function () {
      $('#msg').text('Browser (Width : ' 
                         + $(window).width() 
         + ' , Height :' + $(window).height() + ' )');
        });

        $(document).ready(function() {
       // DOCUMENT READY

       function GetWidth() {
            if (self.innerWidth) {
                    return self.innerWidth;
                }
                else if (document.documentElement && 
                             document.documentElement.clientHeight) {
                    return document.documentElement.clientWidth;
                }
                else if (document.body) {
                    return 0;
                }
                return x;
            }

            function GetHeight() {
                if (self.innerHeight) {
                    y = self.innerHeight;
                }
                else if (document.documentElement && 
                           document.documentElement.clientHeight) {
                    return
                                document.documentElement.clientHeight;
                }
                else if (document.body) {
                    return 0;
                }
                return y;
            }





// This is for when it first loads.                                
$('#TEXT').text('W: ' + $(window).width() + ' , H:' + $(window).height() + y);

// This is for when window gets resized.
$(window).resize(function () {
    $('#TEXT').text('W: ' + $(window).width() + ' , H:' + $(window).height());
});

  // DOCUMENT READY    
  });
 </script>
 </head>

 <body>

Info Area:<br>
<div id="TEXT"></div>

/* IMPORTANT HERE */
<!-- img src="timthumb.php?src=URL...image.jpg&h=180&w=120" -->
/* IMPORTANT HERE */

</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T06:52:59+00:00Added an answer on June 17, 2026 at 6:52 am

    wellcome to stackoverflow!
    the problem is that the php is compiling in server and browser receive a html and javascript file from server
    then your browser compiling your javascript and html code
    so javascript unable to change phpcode
    you can make your html whit javascript like this:

    image = new Image(); 
    image.src = "timthumb.php?src=URL...image.jpg&h="+ hgt + "&w=" + wth;
    
    image.onLoad=function(){ $("img").attr({src: image.src}); }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code in one cpp file which is part of a
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
I have an HTML form POSTing to the following index.php: <?php require_once(/home/full/path/to/included/file.php); ?> And
Situation I am trying to redirect all my traffic to the index.php file one
I have the following code stored in a file called index.php. <?php file_put_contents(date('Y-m-d-H-i-s', time())
When a visitor goes to a index.php file the following code is run. There
I have a .htaccess file with the following rules: RewriteRule ^(boards)/(.+)/(.+)/(.+)/(.+)/([^./+])/?$ index.php?param0=$1&param1=$2&param2=$3&param3=$4&param4=$5&param5=$6 [NC] RewriteRule
I have the following javascript into a index.php file: <script type=text/javascript> $('.showpics, .showpics2').live('click', function()
I'm redirect from one page to the index.php file of the current directory. I'm
Following is my method to append one file onto another file. public static void

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.