成语| 古诗大全| 扒知识| 扒知识繁体

当前位置:首页 > 趣味生活

一个简单的表单用什么数据

Q1:用html做一个简单的表单,怎么提交到数据库?jsp数据库用什么都无所谓!给一个详细的过程和代码!

我用php写吧,习惯了用php

<?phpif(isset($_POST[submit])){$conn=mysql_connect("服务器","用户名","密码")OR DIE("不好意思,可能由于您的人品问题,数据库连接不上!");mysql_select_db("表名",$conn);mysql_query("INSERT INTO 表名(1,2,3)VALUES("提交过来的值,建议设置成变量,要和表里的一段名称一一对应,没有值则留空")");mysql_close($conn);}else{echo"未能成功提交!";}?>

Q2:用数据库vf的表单中各按钮做一个简单的计算器的步骤?

设计步骤如下:注意只是参考一下,具体你自己看着弄,大致如下
(1)建立应用程序用户界面。
选择“新建”表单,进入表单设计器,增加一个文本框控件Textl、一个标签控件Label1和一个命令按钮组CommandGroup1,并将命令按钮组的ButtonCount属性改为16。
(2)设置对象属性如下表所示:
CommandGroup1中各按钮的属性设置
对象 属性 属性值 说明
Command1~Command10 Caption 依次改为:1、2、3、4、5、6、7、8、9、0
FontBold .T.
Command11~Command10 Caption 依次改为:.、=、+、-、*、/
FontBold .T.
(3)编写程序代码。
①编写CommandGroup1的Click事件代码:
IF THISFORM.Tag=.T.
THISFORM.Text1.Value=https://www.bazhishi.com/aldyjtapi/ALLT(RIGHT(STR(THIS.Value),1))
THISFORM.Tag=〃 〃
ELSE
a=THISFORM.Text1.Value
THISFORM.Text1.Value=https://www.bazhishi.com/aldyjtapi/a+ALLT(RIGHT(STR(THIS.Value),1))
ENDIF
②编写“.”按钮Command11的Click事件代码:
a=THISFORM.Text1.Value
THISFORM.Text1.Value=https://www.bazhishi.com/aldyjtapi/a+〃.〃
③编写“=”按钮Command12的Click事件代码:
a=THISFORM.Text1.Value
THISFORM.Text1.Value=https://www.bazhishi.com/aldyjtapi/ALLT(STR(&a))
THISFORM.Tag=.T.
④编写“+”按钮Command13的Click事件代码:
a=THISFORM.Text1.Value
THISFORM.Text1.Value=https://www.bazhishi.com/aldyjtapi/a+〃+〃
THISFORM.Tag=〃 〃
⑤编写“-”按钮Command14的Click事件代码:
a=THISFORM.Text1.Value
THISFORM.Text1.Value=https://www.bazhishi.com/aldyjtapi/a+〃-〃
THISFORM.Tag=〃 〃
⑥编写“*”按钮Command15的Click事件代码:
a=THISFORM.Text1.Value
THISFORM.Text1.Value=https://www.bazhishi.com/aldyjtapi/a+〃*〃
THISFORM.Tag=〃 〃
⑦编写“/”按钮Command16的Click事件代码:
a=THISFORM.Text1.Value
THISFORM.Text1.Value=https://www.bazhishi.com/aldyjtapi/a+〃+〃
THISFORM.Tag=〃 〃

Q3:我这样简单的一个验证表单数据和数据库数据的PHP语句有错吗?

12345678<?phpheader(Content-type:text/html;charset=utf-8);includeconn.php;$user=$_POST[user];$password=$_POST[password];$result=mysql_query("selectusername,passwordfromtb_starwhereusername={$user}andpassword={$password}",$conn)ordie(mysql_error());echomysql_num_rows($result)?登录成功:用户名或密码错误;mysql_close($conn);

Q4:需要一个HTML模板,用来做简单的表单数据录入




- PHP2WORD 邮件与信封生成 -
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<style type="text/css">
body{
font-family: Tahoma,Verdana, Arial, Helvetica, sans-serif;
font-size:15px;
}
p, h1, form, button{border:0; margin:0; padding:0;}
.spacer{clear:both; height:1px;}
/* ———– My Form ———– */
.myform{
margin:0 auto;
width:400px;
padding:14px;
}
/* ———– stylized ———– */
#stylized{
border:solid 2px #b7ddf2;
background:#ebf4fb;
}
#stylized h1 {
font-size:16px;
font-weight:bold;
margin-bottom:8px;
}
#stylized p{
font-size:12px;
color:#666666;
margin-bottom:20px;
border-bottom:solid 1px #b7ddf2;
padding-bottom:10px;
}
#stylized label{
display:block;
font-weight:bold;
text-align:right;
width:140px;
float:left;
}
#stylized .small{
color:#666666;
display:block;
font-size:11px;
font-weight:normal;
text-align:right;
width:140px;
}
#stylized input{
float:left;
font-size:15px;
padding:4px 2px;
border:solid 1px #aacfe4;
width:200px;
margin:2px 0 20px 10px;
}
#stylized .sub{
clear:both;
margin-left:150px;
width:120px;
height:32px;
line-height:20px;
border:1px solid #8b9c56;
background:url("../images/bt_bg.gif") 0px -64px;
text-align:center;
color:#336600;
font-size:15px;
font-weight:bold;
cursor:pointer;
}
.red{
color:#ff0000;
}
.blue{
color:#0000FF;
}
</style>
成语| 古诗大全| 扒知识| 扒知识繁体
<body>



表单标题


副标题以及需要注意的 醒目的 事项











WWw.bAzHIS%Hi.COM

猜你喜欢

更多