PHP Classes

File: language.set.php

Recommend this page to a friend!
  Classes of Dannel   PHP Language Change   language.set.php   Download  
File: language.set.php
Role: Auxiliary script
Content type: text/plain
Description: Lang script to set the cookie
Class: PHP Language Change
Change application language using arrays of text
Author: By
Last change:
Date: 4 years ago
Size: 940 bytes
 

Contents

Class file image Download
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0, maximum-scale=1, user-scalable=no, minimal-ui">
<head>
  <title>Example</title>
</head>

<body>

<?php
if(isset($_REQUEST['ref'])){$ref=$_REQUEST['ref'];}else{$ref="";};
if(isset(
$_POST['l'])){
$lang= $_POST['l'];
$cookie_name = "lang";
setcookie($cookie_name, $lang, time() + (86400), "/");
sleep(2);
header("Location: example.php");
?>
<?php
}else{

?>
<fieldset><legend>Idioma Preferido / Preferred Language</legend>
<form action="" method="POST">
<select name="l">
<option value="esp">Espa&ntilde;ol</option>
<option value="eng">English</option>
</select>
<input type="submit" value="OK"/>
</form>

</fieldset>
<?php
}
?>

</body>

</html>