Page 1/3 of source code (2) of a php Forum program imitating oso
Last Update:2018-12-08
Source: Internet
Author: User
Procedure 2: addforum. php
<Html>
<Head>
<Link rel = "STYLESHEET" type = "text/css" href = "fp_zhangcg.css">
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<Meta name = "Microsoft Theme" content = "none">
<Meta name = "Microsoft Border" content = "none">
<Title> Publish information </title>
</Head>
<Body bgcolor = "# C0C0C0" background = "backcolor.gif">
<SCRIPT language = JavaScript>
<! --
Var submitcount = 0;
Function checkSubmit (){
If (submitcount = 0)
{
Submitcount ++;
Return true;
}
Else {
If (submitcount> 0 ){
Alert ("the post has been submitted successfully. Do not post it again! Couldn't submit the form twice, please. "); return false;
}
}
}
Function check_com (){
If (document. form. username. value. length = 0 ){
Submitcount --;
Alert ("Enter your online name! NPlease input your user name .");
Return false;
}
If (document. form. forumtitle. value. length = 0 ){
Submitcount --;
Alert ("the topic cannot be blank! NYou must supply a subject .");
Return false;
}
If (document. form. forumcontent. value. length = 0 ){
Submitcount --;
Alert ("add content cannot be blank! NYou must supply a message .");
Return false;
}
Return true;
}
// -->
</SCRIPT>
<?
Include ("c: mydbheader. inc ");
?>
<?
If (empty ($ theme_id )){
$ Theme_id = 0;
}
?>
<Table width = "750" border = "0">
<Tr>
<?
If ($ theme_id = 0 ){
Print '<td class = "text"> current location: homepage -- Forum </td> ';
}
Else
{
Print '<td class = "text"> current location: homepage -- Forum -- reply to post </td> ';
}
?>
<Td> </td>
</Tr>
</Table>
<?
Print '<form action = "readforum. php? Readflag = 0 "';
Print 'method = post name = form onsubmit = "return check_com ()"> ';
?>
<Table width = "750" border = "0">
<Tr>
& Lt; td width = "131" class = "text" & gt;
<Div align = "right"> <span class = "text"> <span class = "text"> your big name </span>: </span> </div>
</Td>
& Lt; td width = "609" & gt;
<Input type = "text" name = "username" size = "80" value = "" maxlength = "12">
<Font color = "# ff0000"> * </font> </td>
</Tr>
<Tr>
& Lt; td width = "131" class = "text" & gt;
<Div align = "right"> E_mail: </div>
</Td>
& Lt; td width = "609" & gt;
<Input type = "text" name = "useremail" size = "80">
</Td>
</Tr>
<Tr>
& Lt; td width = "131" class = "text" & gt;
<Div align = "right"> your homepage: </div>
</Td>
& Lt; td width = "609" & gt;
<P>
<Input type = "text" name = "userhttp" size = "80" value = "http: //">
</P>
</Td>
</Tr>
<Tr>
& Lt; td width = "131" class = "text" & gt;
<?
If ($ theme_id = 0 ){
Print '<div align = "right"> post title: </div> ';
Print '</td> <td width = "609" type = "codeph" text = "/codeph"> ';