- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
<?php
mysql_connect ($server, $username, $password);
//Данные на базу
$lnk = mysql_connect('localhost', 'mysql_user', 'mysql_password')
or die ('Not connected : ' . mysql_error());
mysql_select_db('primecms_db', $lnk) or die ('Can\'t primecms_db foo : ' . mysql_error());
class insert{
var $pid, $alias, $text, $position, $status, $create_time, $modify_time;
}
function con_in($pid, $alias, $text_en, $text_ru, $text_descr, $position, $status, $create_time, $modify_time){
$res = new insert;
$res->pid=$pid;
$res->alias=addslashes($alias);
$res->text='<p>'.addslashes($text_en).'</p>\r\n<p>'.addslashes($text_ru).'</p>\r\n<p>'.addslashes($text_descr).'</p>';
$res->position=$position;
$res->status=$status;
$res->create_time=$create_time;
$res->modify_time=$modify_time;
return $res;
}
if ($_POST['send']){
$con = con_in($_POST['pid'],$_POST['alias'],$_POST['text_en'],$_POST['text_ru'],$_POST['text_descr'],$_POST['position'],$_POST['status'],$_POST['create_time'],$_POST['modify_time']);
mysql_query("INSERT INTO e118_glossary_items (`id`, `pid`, `alias`, `text`, `position`, `status`, `create_time`, `modify_time`) VALUES (".$con->pid.",".$con->alias.",".$con->text.",".$con->position.",".$con->status.",".$con->create_time.",".$con->modify_time.")");
}
?>
<form name="" action="" method="post">
Pid<input name="pid" size=30 type="text" value=""><br />
Allias<input name="allias" size=30 type="text" value=""><br />
text_en<input name="text_en" size=30 type="text" value=""><br />
text_ru<input name="text_ru" size=30 type="text" value=""><br />
text decr<textarea name="text_descr" rows=7 cols=50 wrap="off"></textarea><br />
position<input name="position" size=30 type="text" value=""><br />
status<input name="status" size=30 type="text" value=""> <br />
create_time<input name="create_time" size=30 type="text" value=""><br />
modify_time<input name="modify_time" size=30 type="text" value=""><br />
<input type="submit" value="Send" name="send"><br />
</form>