hi guys,
this is my first post
i have the function:
<?php
if( $_POST["name"] ) {
if (preg_match("/[^A-Za-z'-]/",$_POST['name'] )) {
$_SESSION['TDM_LANG']='it';
TDMRedirect($_SERVER['REQUEST_URI']);
}
else {$_SESSION['TDM_LANG']='en';
TDMRedirect($_SERVER['REQUEST_URI']);
}
exit();
}
?>
<html>
<body>
<form action = "<?php $_PHP_SELF ?>" method = "POST">
Name: <input type = "text" name = "name" />
<input type = "submit" />
</form>
</body>
</html>
but i need to correct it: with this function i change the module language with a form, if the input are numbers i get italian language, if the input are letters i get the english language. I need to modify the condition in a really simple way, cancel the input form and get this:
italianflag.jpg if i click on this so
{
$SESSION['TDM_LANG']='it';
TDMRedirect($SERVER['REQUEST_URI']);
}
englishflag.jpg if i click on this so:
{$SESSION['TDM_LANG']='en';
TDMRedirect($SERVER['REQUEST_URI']);
}
what i need is to edit the condition of php and html, getting crazy with this stupid function... thanks in advance!!!
i took this example that is working on my site but is not suitable to my needs, i simply need the same result when i click on links of two flags