Getting Screen Resolution PHP
// jQUERY FILE
$(function() {
$.post('some_script.php', { width: screen.width, height:screen.height }, function(json) {
if(json.outcome == 'success') {
// do something with the knowledge possibly?
} else {
alert('Unable to let PHP know what the screen resolution is!');
}
},'json');
});
// PHP FILE
<?php
// For instance, you can do something like this:
if(isset($_POST['width']) && isset($_POST['height'])) {
$_SESSION['screen_width'] = $_POST['width'];
$_SESSION['screen_height'] = $_POST['height'];
echo json_encode(array('outcome'=>'success'));
} else {
echo json_encode(array('outcome'=>'error','error'=>"Couldn't save dimension info"));
}
?>
Also in PHP:
- TEXT UPPER PHP
- consolelog php response
- check if string exists in string php
- chekck type of php
- download php artisan
- eader("Location
- cristal clear
- check if index of array exists php
- check if string contains letter php
- Warning: mysqli_error() expects exactly 1 parameter, 0
- Schema::defaultStringLengyh(191);
- date time with am pm in php
- catching exceptions php
- check if key is already exist in an associative array php
- capital string php
- afficher type et contenu d'une variable php
- add one day in php
- add column in laravel migration
- console.log php page
- Using a variable outside of the while loop (scope)
- enable the cache mechanisms laravel
- check a specific word exist in php
- console.log in pgp
- In AbstractMySQLDriver.php line 128: An exception occurred in driver: could not find driver