<?
/**
* Unlimited Classification
* 2011/8/23
* Kcj
**/
Include "../conn. php ";
$ Flpid =$ _ POST ['flid'];
$ Fltitle = $ _ POST ['title'];
$ Fldes = $ _ POST ['des '];
If (isset ($ _ POST ['action'])! = ''& $ _ POST ['action'] =" add "){
$ SQL = "insert into fenlei (flpid, fltitle, fldes) value ('". $ flpid. "','". $ fltitle. "','". $ fldes. "')";
Mysql_query ($ SQL );
}
?>
<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
<Title> untitled document </title>
<Meta name = "Author" content = "kcj"/>
<Meta name = "Keywords" content = "php, lampbrother"/>
<Link rel = "stylesheet" type = "text/css" href = "style/lampcms.css">
<Script src = "javascript/common. js"> </script>
<Script type = "text/javascript">
Function vaFl (addfl ){
If (addfl. title. value = ''){
Alert ("the topic name cannot be blank! ");
Addfl. title. focus ();
Return false;
}
If (addfl. des. value = ''){
Alert ("topic description cannot be blank! ");
Addfl. des. focus ();
Return false;
}
}
</Script>
</Head>
<Body>
<Div id = "main">
Background Management-> Add category
<Form method = "post" action = "" name = "addfl" onsubmit = "return vaFl (this)">
<Div class = "msg-box">
<Ul class = "viewmess">
<Li class = "light-row">
<Span class = "col_width"> upper-level column </span>
<Select name = "flpid">
<Option value = "0"> select a Category </option>
<? Php
$ SQL = "SELECT * FROM fenlei where flpid = 0"; // a silly unlimited Classification
$ Rs = mysql_query ($ SQL );
While ($ row = mysql_fetch_array ($ rs) {var_dump ($ row );
Echo "<option value = \" $ row [flid] \ "> $ row [fltitle] </option> ";
$ SQL = "select * from fenlei where flpid = $ row [flid]";
$ Rs_son = mysql_query ($ SQL );
While ($ row_son = mysql_fetch_array ($ rs_son )){
Echo "<option value = \" $ row_son [flid] \ "> $ row_son [fltitle] </option> ";
}
}
?>
</Select>
</Li>
<Li class = "dark-row">
<Span class = "col_width"> topic name <span class = "red_font"> * </span>
<Input type = "text" class = "text-box" name = "title" maxlength = "30" size = "20">
</Li>
<Li class = "light-row">
<Span class = "col_width" style = "margin-top: 30px"> topic description </span>
<Textarea class = "text-box" name = "des" cols = "30" rows = "5"> </textarea>
</Li>
<Li class = "light-row">
<Span class = "col_width"> </span>
<Input type = "hidden" name = "action" value = "add">
<Input type = "submit" class = "button" name = "mod" value = "add category">
<Input type = "reset" class = "button" value = "reset">
</Li>
</Ul>
</Div>
</Form>
</Div>
</Body>
</Html>
<?
/**
* Unlimited Classification
* 2011/8/23
* Kcj
**/
Include "../conn. php ";
$ Flpid =$ _ POST ['flid'];
$ Fltitle = $ _ POST ['title'];
$ Fldes = $ _ POST ['des '];
If (isset ($ _ POST ['action'])! = ''& $ _ POST ['action'] =" add "){
$ SQL = "insert into fenlei (flpid, fltitle, fldes) value ('". $ flpid. "','". $ fltitle. "','". $ fldes. "')";
Mysql_query ($ SQL );
}
?>
<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
<Title> untitled document </title>
<Meta name = "Author" content = "kcj"/>
<Meta name = "Keywords" content = "php, lampbrother"/>
<Link rel = "stylesheet" type = "text/css" href = "style/lampcms.css">
<Script src = "javascript/common. js"> </script>
<Script type = "text/javascript">
Function vaFl (addfl ){
If (addfl. title. value = ''){
Alert ("the topic name cannot be blank! ");
Addfl. title. focus ();
Return false;
}
If (addfl. des. value = ''){
Alert ("topic description cannot be blank! ");
Addfl. des. focus ();
Return false;
}
}
</Script>
</Head>
<Body>
<Div id = "main">
Background Management-> Add category
<Form method = "post" action = "" name = "addfl" onsubmit = "return vaFl (this)">
<Div class = "msg-box">
<Ul class = "viewmess">
<Li class = "light-row">
<Span class = "col_width"> upper-level column </span>
<Select name = "flpid">
<Option value = "0"> select a Category </option>
<? Php
$ SQL = "SELECT * FROM fenlei where flpid = 0"; // a silly unlimited Classification
$ Rs = mysql_query ($ SQL );
While ($ row = mysql_fetch_array ($ rs) {var_dump ($ row );
Echo "<option value = \" $ row [flid] \ "> $ row [fltitle] </option> ";
$ SQL = "select * from fenlei where flpid = $ row [flid]";
$ Rs_son = mysql_query ($ SQL );
While ($ row_son = mysql_fetch_array ($ rs_son )){
Echo "<option value = \" $ row_son [flid] \ "> $ row_son [fltitle] </option> ";
}
}
?>
</Select>
</Li>
<Li class = "dark-row">
<Span class = "col_width"> topic name <span class = "red_font"> * </span>
<Input type = "text" class = "text-box" name = "title" maxlength = "30" size = "20">
</Li>
<Li class = "light-row">
<Span class = "col_width" style = "margin-top: 30px"> topic description </span>
<Textarea class = "text-box" name = "des" cols = "30" rows = "5"> </textarea>
</Li>
<Li class = "light-row">
<Span class = "col_width"> </span>
<Input type = "hidden" name = "action" value = "add">
<Input type = "submit" class = "button" name = "mod" value = "add category">
<Input type = "reset" class = "button" value = "reset">
</Li>
</Ul>
</Div>
</Form>
</Div>
</Body>
</Html>
From chaojie2009