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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:15:35+00:00 2026-05-16T12:15:35+00:00

I have a simple PHP script that sends a message to a specified email

  • 0

I have a simple PHP script that sends a message to a specified email address with content from a HTML form using the mail() function (which I am aware is prone to spam).

I was wondering if it’s possible to obtain additional information about the user’s settings and input them in the sent mail.

Additional information could contain:

  • Browser type and version Whether
  • Javascript is enabled or disabled
  • Operating system Resolution

If any of those are possible, that would be awesome.

Thanks,
Amit

EDIT: Thanks to @Stephen, I was able to use the $_SERVER[‘HTTP_USER_AGENT’] to get more info regarding the browser. However, when using the get_browser, it did not work. This is my code:

$browser = get_browser(null, true);

$message = 'From: ' . "\n\n" . 
'Name: ' . $_REQUEST['name'] . "\n\n" . 
'E-mail: ' . $_REQUEST['email'] . "\n\n" . 
'Comments: ' . $_REQUEST['comments'] . "\n\n" . 
'Details: ' . $_SERVER['HTTP_USER_AGENT'] . "\n\n" . 
'Further: ' . echo ($browser);

Anyone knows the reason why?

Thanks!

  • 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-16T12:15:35+00:00Added an answer on May 16, 2026 at 12:15 pm

    Many details can be found by parsing the $_SERVER['HTTP_USER_AGENT'] variable. Example for my current computer is:

    echo $_SERVER['HTTP_USER_AGENT']
    // Output: "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8"
    

    Remember that the contents of this are not a definite sign – browsers can and do (sometimes deliberately, sometimes accidentally) lie about their origins.

    Note there are some functions like get_browser which wrap the HTTP_USER_AGENT to return some useful information too.

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

Sidebar

Related Questions

I have a simple php script on my domain that sends me an email:
I have a simple PHP script that will either serve up a streaming ASF
I have a very simple script that creates a user: <?php include 'mysqlserver.php'; session_start();
I have a simple script of code that reads a PHP file and when
Here I have a simple php script which displays some values from a database
I have simple php validation form that is halfway working. If you leave the
I have a PHP mail script that successfully sends emails to everything BUT GMail
I have a very simple php ldap script that is only failing when running
I have found this little script in PHP that send a simple request to
I have a PHP script that deletes files. It can delete files from my

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.