i need to do following process:
IF system is Windows, display a C++ COM control
ELSE
IF JRE is installed on the system, display a APPLET
ELSE
display error message
are there php functios which can help me to check and implement above process?
thanks
how to check PC system of a visitor?
Moderator: General Moderators
-
aaaphp000000
- Forum Newbie
- Posts: 22
- Joined: Mon Aug 29, 2005 5:39 am
The first part is quite easy 
The second part I would guess you'll need a JavaScript function to make the check, as I doubt the User Agent (browser) broadcasts that kind of information to the server (remember, PHP is server side and entirely depends upon the information the User Agent sends to the server)

Code: Select all
<?php
if (strpos(PHP_OS, "WIN") !== false) {
/* enter code for displaying COM panel */
}
?>- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England
Dammit, I quickly copied and pasted from one of my own classes not thinking about it.
And using double negatives is NOT bad practice when challenging such criteria. Read up on PHP.net.
Fixed code:
And using double negatives is NOT bad practice when challenging such criteria. Read up on PHP.net.
Fixed code:
Code: Select all
<?php
if (stripos('Win', $_SERVER['HTTP_USERAGENT']) !== false) {
/* do com bits */
}
?>