php网页制作

怎么用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)向我提问,同为开发者,理应相互帮助,有问必答!望采纳....

自己用php开发一个简单的网站,包括后台和前台,开发的步骤,麻烦详细一点,就是一些文字性

1、首先你得搭建PHP运行环境。建议使用PHP开发速成搭建工具包xampp。集成php+phpmyadm+mysql2、第二步,写需求,如图书管理系统。是否需要会员系统(会员是否分等级如普通、VIP分等级的话,那么有这些等级之间有什么差别)、是否需要文章发布、是否需要图书信息发布、是否需要在线购买书籍、是否要对书籍进行留言评论、是否要有在线试读。3、针对上面列出的需求,进行数据库的表设计。表的设计要根据以上的需求来。4、确定怎么对网站进行架构,因为这是一个系统了。是一个系统化的东西,而不是其中某一个小模块功能。你必须要对自己的网站来做一个架构。以使将来有可能网站进行功能模块增加、网站风格改版提供支持,如果只是单纯的PHP写法,将来网站维护改版会很麻烦的,前期一个好的系统架构很重要。这就是为什么很多好的程序员都会喜欢用自己熟悉的某一PHP框架来进行编程了。当然,你也可以自己构思自己的框架,当然这个是需要有对PHP这门语言相当熟练,在通过自己的理解,自己的需要编写适合自己或大众的框架。如zend framework 、thinphp、qeephp、smarty、cakephp等等,要知道一个好的框架不是一天就能写出来的,都是日积月累的。5、程序实现了你自己的需求,然后就是测试了。测试,可以分的很细了。如数据完整性验证。数据有效性、操作步骤一致性、6、以上则完成。

如何用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和sql么?那能教我一些问题么、、就sql查询会么 那你得有具体的需求啊,要查询什么,实现什么功能 恩,那加我行么、2758839856

自己用php开发一个简单的网站,包括后台和前台,开发的步骤,麻烦详细一点,就是一些文字性

1、首先你得搭建PHP运行环境。建议使用PHP开发速成搭建工具包xampp。集成php+phpmyadm+mysql2、第二步,写需求,如图书管理系统。是否需要会员系统(会员是否分等级如普通、VIP分等级的话,那么有这些等级之间有什么差别)、是否需要文章发布、是否需要图书信息发布、是否需要在线购买书籍、是否要对书籍进行留言评论、是否要有在线试读。3、针对上面列出的需求,进行数据库的表设计。表的设计要根据以上的需求来。4、确定怎么对网站进行架构,因为这是一个系统了。是一个系统化的东西,而不是其中某一个小模块功能。你必须要对自己的网站来做一个架构。以使将来有可能网站进行功能模块增加、网站风格改版提供支持,如果只是单纯的PHP写法,将来网站维护改版会很麻烦的,前期一个好的系统架构很重要。这就是为什么很多好的程序员都会喜欢用自己熟悉的某一PHP框架来进行编程了。当然,你也可以自己构思自己的框架,当然这个是需要有对PHP这门语言相当熟练,在通过自己的理解,自己的需要编写适合自己或大众的框架。如zend framework 、thinphp、qeephp、smarty、cakephp等等,要知道一个好的框架不是一天就能写出来的,都是日积月累的。5、程序实现了你自己的需求,然后就是测试了。测试,可以分的很细了。如数据完整性验证。数据有效性、操作步骤一致性、6、以上则完成。

PHP制作了用户登录页面,不管输入什么都显示用户名密码不能为空,要怎么解决

sql语句username='$name' and password='$password' 改为 username='.$name.' and password='.$password.' 还是这样啊,不管我账户密码对还是错,都显示用户名密码不能为空 你在php页面输出或弹出一个框,内容是你的账号密码,看一下是否获取了账号密码,如果有,在看一下sql语句是否执行成功。row是否有数据

php编程的网站已经上传,如何用源码对首页怎么修改?

用记事本方式打开Index.php文件不过这样不建议,比如ourphp系统,采用的是utf-8编码这样的话不能直接用记事本编辑可以用专业的编辑软件 打开PHP原码 修改就行了

用php制作一个网站

1、确定主题,也就是想要做什么样的网站,功能是什么,做个方案先2、确定谁写代码。外包还是自己写3、执行方案。网站的功能,网站前台界面,色调版面4、代码调试。写好了不能直接上线哦,需要调试5、试用。先在调试环境运行,没有问题了就可以上线。 6、逐渐修改。维护了,代码要更新,漏洞要补7,日常管理。文章的编写,用户的管理等等

在线等!急! 用PHP编写程序,实现简单的用户登录页面 (1)制作login.html用户登录页面,效果图如下:

login.html<form action="login.php" method="post" name="formUser" > <table width="100%" border="0" align="left" cellpadding="5" cellspacing="3"> <tr> <td width="25%" align="right">用户名:</td> <td width="65%"> <input name="username" type="text" size="25" id="username" /> </td> </tr> <tr> <td align="right">登陆密码:</td> <td> <input name="password" type="password" id="password1" style="width:179px;" /> </td> </tr> <tr> <td align="right">确认密码:</td> <td> <input name="confirm_password" type="password" id="conform_password" style="width:179px;"/> </td> </tr> <tr> <td align="right">选择性别:</td> <td> <input name="rd1" type="radio" size="25" id="rd1" value="男" checked/> <input name="rd2" type="radio" size="25" id="rd2" value="男"/> </td> </tr> <tr> <td align="right">个人爱好:</td> <td> <input name="ck1" type="checkbox" size="25" id="ck1" value="音乐" checked/> <input name="ck2" type="checkbox" size="25" id="ck2" value="游戏"/> <input name="ck3" type="checkbox" size="25" id="ck3" value="电影"/> </td> </tr><tr> <td align="right">备注信息:</td> <td> <input name="t1" type="text" size="25" id="t1" value="" /> </td> </tr> <tr> <td > <input name="Submit" type="submit" value="普通提交按钮" > </td> <td> <input name="btn1" type="btn" value="重置按钮" > </td> </tr> </table> </form>login.php $username = isset($_POST['username']) ? trim($_POST['username']) : ''; $password = isset($_POST['password']) ? trim($_POST['password']) : ''; if (strlen($password) < 6) { show_message($_LANG['passport_js']['password_shorter']); } if (strpos($password, ' ') > 0) { show_message($_LANG['passwd_balnk']); } if (register($username, $password) !== false) { /*把新注册用户的扩展信息插入数据库*/ $sql = 'SELECT id FROM ' . $ecs->table('reg_fields') . ' WHERE type = 0 AND display = 1 ORDER BY dis_order, id'; //读出所有自定义扩展字段的id $fields_arr = $db->getAll($sql); $extend_field_str = ''; //生成扩展字段的内容字符串 foreach ($fields_arr AS $val) { $extend_field_index = 'extend_field' . $val['id']; if(!empty($_POST[$extend_field_index])) { $temp_field_content = strlen($_POST[$extend_field_index]) > 100 ? mb_substr($_POST[$extend_field_index], 0, 99) : $_POST[$extend_field_index]; $extend_field_str .= " ('" . $_SESSION['user_id'] . "', '" . $val['id'] . "', '" . compile_str($temp_field_content) . "'),"; } } $extend_field_str = substr($extend_field_str, 0, -1); if ($extend_field_str) //插入注册扩展数据 { $sql = 'INSERT INTO '. $ecs->table('reg_extend_info') . ' (`user_id`, `reg_field_id`, `content`) VALUES' . $extend_field_str; $db->query($sql); } } else { $err->show($_LANG['sign_up'], 'login.php?act=login'); }

用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制作表格?

两种方法:1、将Html代码和PHP代码混合嵌入,如:<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title></head><body><table width="350" border="1">  <tr>    <td width="103"><?php echo("td1");?></td>    <td width="115"> </td>    <td width="110"> </td>  </tr>  <tr>    <td><?php echo("td2");?></td>    <td> </td>    <td> </td>  </tr>  <tr>    <td><?php echo("td3");?></td>    <td> </td>    <td> </td>  </tr></table></body></html>效果图:第二种方法:直接用PHP代码输出html型表格代码,如:<?phpecho("<table width=350 border=1>");echo("<tr><td width=115> </td><td width=110> </td></tr><tr><td> </td><td> </td></tr>");echo("</table>");?>效果图:

建站需求填写

采购需求填写

采购需求

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