2 require_once("language.inc.php");
5 if ($_POST['Submit']=='Add'){
8 if (!check_pattern ($_POST['lang_code'],$pat)) {
9 xl ("Code must be two letter lowercase",'e','','<br>');
14 if (!check_pattern ($_POST['lang_name'],$pat)) {
15 echo ("Only letters accepted for description<br>");
19 $sql="SELECT * FROM lang_languages WHERE lang_code LIKE '%".$_POST['lang_code']."%' or lang_description LIKE '%".$_POST['lang_name']."' limit 1" ;
22 xl ("Data Alike is already in database, please change code and/or description",'e','','<br>');
26 $val_lang_code=$_POST['lang_code'];
27 $val_lang_name=$_POST['lang_name'];
29 $sql="INSERT INTO lang_languages SET lang_code='".$_POST['lang_code']."', lang_description='".$_POST['lang_name']."'";
31 xl('Language definition added','e','','<br>');
38 <FORM name
="lang_form" METHOD
=POST ACTION
="?m=language">
40 <TD
><?php
xl('Language Code','e') ?
>:</TD
>
41 <TD
><INPUT TYPE
="text" NAME
="lang_code" size
="2" maxlength
="2" value
="<?php echo $val_lang_code; ?>"></TD
>
44 <TD
><?php
xl('Language Name','e') ?
>:</TD
>
45 <TD
><INPUT TYPE
="text" NAME
="lang_name" size
="24" value
="<?php echo $val_lang_name; ?>"></TD
>
49 <TD
><INPUT TYPE
="submit" name
="Submit" value
="<?php xl('Add','e'); ?>"></TD
>