A silly unlimited Classification

Source: Internet
Author: User

<?
/**
* 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.