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 6736203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:06:08+00:00 2026-05-26T11:06:08+00:00

I was wondering if I can use PHP and Javascript to get the screen

  • 0

I was wondering if I can use PHP and Javascript to get the screen resolution from my users. Altho this is a simple thing, I was wondering if I can execute the JavaScript within a PHP statement and not output the Javascript code to the browser as HTML

I thought maybe putting it in an EOF block, but that didn’t work, the output was the actual script haha.

I want to be able to populate a $width and $height within my PHP script and create a variable to look something like

$resolution = 800x600

I know I can place the javascript in the HTML page and then have a PHP block capture the javascript output, but I am using the Smarty template engine and have disabled the use of PHP within the templates for security reasons.

Is there a way to accomplish this?

I don’t want to use the resolution for any url manipulating but rather to store the information for my statistical reasons.

  • 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-05-26T11:06:09+00:00Added an answer on May 26, 2026 at 11:06 am

    I don’t think what you want is really possible. It has to be in the HTML output for the browser to execute it.

    You can capture it in the page JavaScript and use an AJAX call to POST it back to the server… but at that point you may as well use Google Analytics, because I’m pretty sure that’s essentially what they do (but their framework is supported by, well… Google). Using Google Analytics will also prove to be useful, since they capture a number of other statistics as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm wondering how you can use Yahoo Pipes to get any tweets than contain
I am wondering how I can get the document title in LaTex, for use
I'm wondering how can I use Lucene for searching and indexing with PHP, Google
I am currently using this script to get new data every second from record_count.php
I'm just wondering if you can use both of them in a PHP code.
I'm new to PHP but was wondering how this can be done. I want
i was wondering how i can use php to access text files and display
I am wondering if you can use Linq to SQL using a .mdf file
I am wondering how I can use google protocol buffers to accept a request
I'm wondering if I can use a static variable for optimization: public function Bar()

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.