php制作网页

网页制作中如何将表单中的内容居中

有几种解决办法。1、添加样式text-align: center; 内容居中。2、给表单一个容器DIV,然后给DIV添加居中的样式。margin:0 auto ;如果以上办法不能解决。可能是有一些兼容的问题、或者是受前面内容的影响。那可以在表单的前面添加一个去除浮动的样式。clear:both比如这个例子: 就给表单form添加了一个容器table,并给table设置align=“center"居中的样式。12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455<table align="center" width="500" border="0" cellpadding="2" cellspacing="0">            <caption align="center"><h2>LAMP学员基本信息</h2></caption>                         <form action="server.php" method="post">                <tr>  <!--  使用输入域定义姓名输入框 --->                    <th>姓名:</th>                    <td ><input type="text" name="username" size="20" /></td>                </tr>                                 <tr>     <!-- 使用单选按钮域定义性别输入框 -->                    <th>性别:</th>                    <td>                        <input type="radio" name="sex" value="1" checked="checked" />男                        <input type="radio" name="sex" value="2" />女                        <input type="radio" name="sex" value="3" />保密                    </td>                </tr>                                 <tr>  <!--  使用下拉列表域定义学历输入框  -->                    <th>学历:</th>                    <td>                        <select name="edu">                            <option>--请选择--</option>                            <option value="1">高中</option>                            <option value="2">大专</option>                            <option value="3">本科</option>                            <option value="4">研究生</option>                            <option value="5">其他</option>                        </select>                    </td>                </tr>                                 <tr>  <!-- 使用复选框按钮域定义选修课程输入框 -->                    <th>选修课程:</th>                    <td>                        <input type="checkbox" name="course[]" value="4">Linux                        <input type="checkbox" name="course[]" value="5">Apache                        <input type="checkbox" name="course[]" value="6">Mysql                        <input type="checkbox" name="course[]" value="7">PHP                    </td>                </tr>                                 <tr>  <!-- 使用多行输入框定义自我[评价输入框 -->                    <th>自我评价:</th>                    <td><textarea name="eval" rows="4" cols="40"></textarea></td>                </tr>                                 <tr>  <!--  定义提交和重置两个按钮-->                    <td colspan="2" align="center">                        <input type="submit" name="submit" value="提交">                        <input type="reset" name="reset" value="重置">                    </td>                </tr>            </form>        </table>

请问做一个网站的基本步骤是什么,我用的是PHP+mysql开发的一个网站,想了解用这个语言开发网站的详细步骤

php的话网站就是用html+css+javascript+php+mysql我就拿我做网站来说我是用thinkphp框架来做先写模板就是html+css部分(当然入口文件先做好),然后再根据具体需要配合php+mysql把功能都实现出来,然后再修改,然后再调试,没问题了就做完了

如何制作输入用户名及密码才可以登陆的网页

使用JavaScript实现。<SCRIPT LANGUAGE="JavaScript"> function Login(form) { var username = lue; var password = lue; var server = lue; if (username && password && server) { var htsite = "http://" + username + ":" + password + "@" + server; window.location = htsite; } else { alert("请输入用户和密码."); } } </script> 把以上内容加到head部分;然后下面的内容放在body里就好了:<form name=login> <input type="hidden" name="server" value=" "> 用户名: <input type=text name=username size=20> 密 码: <input type=password name=password size=20> <input type=button value="登录" onClick="Login( rm)" name="button"> </form>

用HTML做网页和用PHP或者ASP做网页有什么区别?

可能你对WEB开发不太了解,平时你上网打开网站浏览网页,在网页空白处点击鼠标右键选择查看源代码,你看到这些代码呀就是HTML标记语言。1、HTML超文本标记语言是组成网页的基本元素。就是你平时浏览网页看到页面上那些框框呀什么的东西就是由HTML标签表现出来的。就是把你的平常看到的文字、图片、声音、等媒体信息通过一些HTML标签编排组合显示出来了。让后,你还看到有些框框怎么颜色不一样,图片摆放的位置也有不同,这就是CSS样式控制的了。通常说的HTML网页即为静态网页,包含了HTML标记,CSS样式,通常还有JAVASCRIPT。2、php、asp是两种不同的服务器语言技术。就比如你看到一网站有留言页面,刚刚说HTML的作用就是把那些框框按钮表现出来。如果没有php、asp这样的后台服务器语言做交互逻辑处理,那么你点击提交留言是不会成功的。所以说HTML是做静态网页,不负责处理逻辑、数据,只是用于如何显示给用户看到的东西。当用php或者asp语言做后台服务器处理后,你提交的留言才会被处理收集录入数据库。当使用php或者asp开发,一般叫做动态网页,即为可以和用户交互的。注意php、asp分别为不同的语言,他们都可以做后台开发的。以上仅为个人观点

怎么在网页上用PHP 做个搜索功能?

通过from表单,将查询的关键词,通过 like 跟数据进行模糊查询对比从topics表中查询字段subject与传进来的参数'$_POST['topic']进行比较模糊查询设subject字段数据为:数学,英语,物理,化学,英文$subject=$_POST['topic']; $sql = "select * from topics where subject like '%" .$subject. "%'";$result = mysql_query($sql);若从表单提交的‘topic’值为“学”,得到的结果将是:数学,化学多个字段匹配查询:$sql = "select id,subject from topics where (id like '%" .$id. "%') or (name like '%" .$name. "%') or (subject like '%" .$subject. "%') order by id desc";结果依据字段id的顺序

为什么php制作网页中无法正常显示中文

很明显数据编码不一致你的网页时gbk的 数据库的表也是设置了gbk那么现在最大可能就是你的文档本身是utf-8的,把文件本身改为gbk试试吧或者在php文件中没有声明头文件header("content-type:text/html;charset=gbk"); 应该加在哪里啊? header("content-type:text/html;charset=gbk");加载.php文件的开头 能截图然后标出吗? <?phpheader("content-type:text/html;charset=gbk");?>就是最开头我现在怀疑你文件本身是utf8的 所以导致乱码 你先看看是不是 嗯,ok了 是utf-8 为什么加了这个后,标题反而变了

用PHP做登陆注册页面

登录页:login.php<?phpinclude("conn.php");$username=$_POST['name'];$password=$_POST['password'];$yanzheng=$_POST['yanzheng'];if(isset($_POST['submit'])){$sql=("select username,password from member where username='$username' and password='$password'") or die("sql语句执行失败");//print_r($sql);$ar=mysql_query($sql);if($ar){if($row=mysql_fetch_array($ar)){ session_start(); if($_POST["yanzheng"]) { if($yanzheng!=$_session[pic]||$yanzheng=="") { echo "验证码输入有误"; exit; } if($yanzheng==$_session[pic]) { header("location:index.php"); } }} else { echo "用户名或密码错误"; } } }?><form action="login.php" method="post"><table border=1 align=center width=500 height=300 bgColor=#DFFFDF bordercolor=#fffbec><tr><td colspan=2 align=center>用户登录</td></tr><tr> <td>用户姓名:</td> <td><input type="text" name="name" id="name"/></td></tr><tr> <td>用户密码:</td> <td><input type="password" name="password" id="password"/></td></tr><tr> <td>验证码:</td> <td><input type="text" name="yanzheng" id="yanzheng"/> <img src="yanzheng1.php" width="50" height="30"></img> </td></tr><tr><td colspan=3 align=center><input type="submit" name="submit" value="登录"/><input type="reset" name="reset" value="重置"/><a href="register.php">注册</a></td></tr> </table></form>注册页:register.php<?php include("conn.php"); if(isset($_POST['submit'])&&$_POST['submit']) { if($_POST['username']=='') { echo "用户名不能为空"; exit(); } if($_POST['password']=='') { echo "密码不能为空"; exit(); } if($_POST['realpass']!=$_POST['password']) { echo "两次密码输入不一致"; exit(); } $sql="insert into member(username,real_name,password,email,headimg) values('$_POST[username]','$_POST[username]','$_POST[password]','$_POST[email]','')"; $ar=mysql_query($sql); if($ar) { header("location:index.php"); } else { echo mysql_error(); } }?><body><form action="register.php" method="post"><table border=1 align=center width=500> <tr> <td height=40 bgColor=#DFFFDF colspan=2>会员注册 [<a href="login.php">返回登录页</a>]</td> </tr> <tr> <td height=40 bgColor=#fffbec >会员ID</td> <td><input type="text" name="username" id="username"/></td> </tr> <tr> <td height=40 bgColor=#fffbec>密码</td> <td><input type="password" name="password" id="password"/></td> </tr> <tr> <td height=40 bgColor=#fffbec>确认密码</td> <td> <input type="password" name="realpass" id="realpass"/> </td> </tr> <tr> <td height=40 bgColor=#fffbec>EMAIL</td> <td><input type="text" name="email" id="email"/></tr> <tr> <td height=40 bgColor=#fffbec></td> <td><input type="submit" name="submit" value="注册"/><input type="reset" value="重置"></td> </tr></table></form></body>主页显示:index.php<?php include("conn.php"); function cutstr($str,$cutleng){$str = $str; //要截取的字符串$cutleng = $cutleng; //要截取的长度$strleng = strlen($str); //字符串长度if($cutleng>$strleng)return $str;//字符串长度小于规定字数时,返回字符串本身$notchinanum = 0; //初始不是汉字的字符数for($i=0;$i<$cutleng;$i++){if(ord(substr($str,$i,1))<=128){$notchinanum++;}}if(($cutleng%2==1)&&($notchinanum%2==0)) //如果要截取奇数个字符,所要截取长度范围内的字符必须含奇数个非汉字,否则截取的长度加一{$cutleng++;}if(($cutleng%2==0)&&($notchinanum%2==1)) //如果要截取偶数个字符,所要截取长度范围内的字符必须含偶数个非汉字,否则截取的长度加一{$cutleng++;}return substr($str,0,$cutleng);}?><html><head> <script type="text/javascript"> function All(e, itemName){var aa = document.getElementsByName(itemName);for (var i=0; i<aa.length; i++) aa[i].checked = e.checked; //得到那个总控的复选框的选中状态}function Item(e, allName){var all = document.getElementsByName(allName)[0];if(!e.checked) all.checked = false;else{ var aa = document.getElementsByName(e.name); for (var i=0; i<aa.length; i++) if(!aa[i].checked) return; all.checked = true;}} </script></head><?php include("conn.php"); if(isset($_POST['del'])) { $mm = $_POST["selected"]; $id =implode(",",$mm); $sql = "delete from forums where id in(".$id.")"; //echo $sql; $result=mysql_query($sql); echo $result?"删除成功":"删除失败"; }?><table style="BORDER-BOTTOM-WIDTH: 1px; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=600 align=center border=1 bordercolor=#ddddff><tr align=middle> <td height=40 bgColor=#DFFFDF colspan=3>论坛列表</td> </tr> <tr> <td colspan=3><a href="login.php" style="float:right">[退出系统]</a><a href="add_forum.php" style="float:right">[添加论坛]</a></td> <td></td> </tr> <tr align=middle> <td height=40 bgColor=#DFFFDF width=80>状态</td> <td height=40 bgColor=#DFFFDF>论坛</td> <td height=40 bgColor=#DFFFDF>最后更新</td> </tr> <?php $sql="select * from forums"; $result=mysql_query($sql); $num=mysql_num_rows($result); if($num>0) { while($row=mysql_fetch_array($result)){ ?> <tr align=middle> <td bgColor=#fffbec><input type="checkbox" name="selected" value="1"/></td> <td height=50 bgColor=#fffbec width=300> <?php echo "<div><a href=\"forums.php?F=".$row['ID']."\">".$row['forum_name']."</a></div>"; echo cutstr($row['forum_description'],24);//最多显示24个字节,12个字,多余部分用省略号代替 echo "……"; ?> </td> <td height=50 bgColor=#fffbec><div><?php echo $row['last_post_time']."by".$row['last_post_author']?></div></td></tr> <?php } } else { echo "<tr bgColor=#fffbec><td colspan=3>对不起,论坛尚在创建中……</td></tr>"; } ?> <tr> <td colspan=3> <input type="checkbox" name="selected" value="1" onclick="All(this,'selected')"/>全选/不全选</td> </tr> <tr> <td><input type="button" name="del" id="del" value="删除选中项"/> <?php ?> </td> </tr></table></html>数据库你就自己建,望采纳~

怎么用php做网站 如何在HTML中利用php

楼上说的很对,但只是理论对你应该没什么帮助!我是做php开发的程序员。首先你要明确的是,html是前端,负责制作网站的前端页面,所谓的前端就是你现在看到的百度知道的页面,这就是前端html+css+js写出来的。而php是一个网站的后端,也就是实现我们能够在百度知道 里面发表问题,回答问题等一系列功能的后端语言。从你问的问题能看出你应该是个初学者,我给你举个实例的代码例子:在HTML中利用php<!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <title>php弹出提示内容</title> </head> <body> //html页面中使用php代码调用js提供的alert弹窗 <?php   echo "<script>alert('我是内嵌在html里面的php代码')</script>"; ?> </body> </html>下面这是实际的运行效果图:php代码可以混合在html中,html也可以混合写到php中。当然想要运行上面我给的代码,你首先需要先在自己电脑搭建本地的web服务器,然后才可以运行php后缀的文件。纯手敲,有问题可以直接,或是到我的工作室QQ群(540144097)向我提问,同为开发者,理应相互帮助,有问必答!望采纳....

建站需求填写

采购需求填写

采购需求

采购产品:
联系人:
* 联系电话:
公司名称:
补充说明:
* 验证码:
提交