OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 10892|回复: 8

WEB服务器怎么做

[复制链接]

23

主题

143

帖子

1

精华

高级会员

Rank: 4

积分
933
金钱
933
注册时间
2012-4-23
在线时间
68 小时
发表于 2012-11-6 18:05:31 | 显示全部楼层 |阅读模式
上网找了很多资料,看起来范围很大,讲的不是很有针对性。
在原子的例程里面对于网页的设计没有相关说明。我没学过网页这个没有基础。不知道做一个需要用到什么内容。
想问一下有了解的朋友,
通过ENC28J60网口芯片,我大概要实现一个网页能够和STM32连接,显示STM32外设的运行状态,就是开启和关闭,同样能够通过网页进行开启和关闭。这个网页需要怎么做?
效果类似于下面这样。



有没有买了战舰的朋友,能不能分享一下例程上面这个网页的源代码?













正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165540
金钱
165540
注册时间
2010-12-1
在线时间
2117 小时
发表于 2012-11-6 18:20:51 | 显示全部楼层
我是开源电子网www.openedv.com站长,有关站务问题请与我联系。
正点原子STM32开发板购买店铺http://openedv.taobao.com
正点原子官方微信公众平台,点击这里关注“正点原子”
回复 支持 反对

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165540
金钱
165540
注册时间
2010-12-1
在线时间
2117 小时
发表于 2012-11-6 18:21:15 | 显示全部楼层
那必须会html编程
我是开源电子网www.openedv.com站长,有关站务问题请与我联系。
正点原子STM32开发板购买店铺http://openedv.taobao.com
正点原子官方微信公众平台,点击这里关注“正点原子”
回复 支持 反对

使用道具 举报

23

主题

143

帖子

1

精华

高级会员

Rank: 4

积分
933
金钱
933
注册时间
2012-4-23
在线时间
68 小时
 楼主| 发表于 2012-11-7 10:31:23 | 显示全部楼层
const struct httpd_fsdata_file file_processes_shtml[] = {{NULL, (const char *)data_processes_shtml, (const char *)data_processes_shtml + 17, sizeof(data_processes_shtml) - 17}};

const struct httpd_fsdata_file file_404_html[] = {{file_processes_shtml, (const char *)data_404_html, (const char *)data_404_html + 10, sizeof(data_404_html) - 10}};

const struct httpd_fsdata_file file_files_shtml[] = {{file_404_html, (const char *)data_files_shtml, (const char *)data_files_shtml + 13, sizeof(data_files_shtml) - 13}};

const struct httpd_fsdata_file file_footer_html[] = {{file_files_shtml, (const char *)data_footer_html, (const char *)data_footer_html + 13, sizeof(data_footer_html) - 13}};

const struct httpd_fsdata_file file_header_html[] = {{file_footer_html, (const char *)data_header_html, (const char *)data_header_html + 13, sizeof(data_header_html) - 13}};


const struct httpd_fsdata_file file_index_html[] = {{file_header_html, (const char *)data_index_html, (const char *)data_index_html + 12, sizeof(data_index_html) - 12}};

const struct httpd_fsdata_file file_style_css[] = {{file_index_html, (const char *)data_style_css,(const char *) data_style_css + 11, sizeof(data_style_css) - 11}};

const struct httpd_fsdata_file file_tcp_shtml[] = {{file_style_css, (const char *)data_tcp_shtml, (const char *)data_tcp_shtml + 11, sizeof(data_tcp_shtml) - 11}};

const struct httpd_fsdata_file file_fade_png[] = {{file_tcp_shtml, (const char *)data_fade_png, (const char *)data_fade_png + 10, sizeof(data_fade_png) - 10}};

const struct httpd_fsdata_file file_stats_shtml[] = {{file_fade_png, (const char *)data_stats_shtml, (const char *)data_stats_shtml + 13, sizeof(data_stats_shtml) - 13}};


这个是一些结构体定义。具体这些定义都是实现什么功能?

网页源代码文件可以通过软件

进行转换。我是想知道原来文件到底是怎么写的,有没有可以帮忙的朋友呢?






回复 支持 反对

使用道具 举报

23

主题

143

帖子

1

精华

高级会员

Rank: 4

积分
933
金钱
933
注册时间
2012-4-23
在线时间
68 小时
 楼主| 发表于 2012-11-7 17:52:33 | 显示全部楼层


就这么一个静态网页,以下是源代码。这水不浅啊。


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns="urn:schemas-microsoft-comfficeffice" xmlns:w="urn:schemas-microsoft-comffice:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="File-List" href="Release_Notes__files/filelist.xml">
<link rel="Edit-Time-Data" href="Release_Notes__files/editdata.mso"><!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>Release Notes for STM32F107 LwIP demonstration package</title><!--[if gte mso 9]><xml>
<oocumentProperties>
<o:Author>STMicroelectronics</o:Author>
<oastAuthor>jlassis</oastAuthor>
<o:Revision>3</o:Revision>
<o:TotalTime>139</o:TotalTime>
<o:Created>2009-11-11T08:13:00Z</o:Created>
<oastSaved>2009-11-11T08:15:00Z</oastSaved>
<oages>1</oages>
<o:Words>171</o:Words>
<o:Characters>980</o:Characters>
<o:Company>STMicroelectronics</o:Company>
<oines>8</oines>
<oaragraphs>2</oaragraphs>
<o:CharactersWithSpaces>1149</o:CharactersWithSpaces>
<o:Version>11.9999</o:Version>
</oocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:Zoom>110</w:Zoom>
<w:SpellingState>Clean</w:SpellingState>
<w:GrammarState>Clean</w:GrammarState>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:Compatibility>
<w:UseFELayout/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<watentStyles DefLockedState="false" LatentStyleCount="156">
</watentStyles>
</xml><![endif]--><style>
<!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;
mso-font-charset:2;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:0 268435456 0 0 -2147483648 0;}
@font-face
{font-family:"MS Mincho";
panose-1:2 2 6 9 4 2 5 8 3 4;
mso-font-alt:"Arial Unicode MS";
mso-font-charset:128;
mso-generic-font-family:roman;
mso-font-formatther;
mso-font-pitch:fixed;
mso-font-signature:1 134676480 16 0 131072 0;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:536871559 0 0 0 415 0;}
@font-face
{font-family:"\@MS Mincho";
panose-1:0 0 0 0 0 0 0 0 0 0;
mso-font-charset:128;
mso-generic-font-family:roman;
mso-font-formatther;
mso-font-pitch:fixed;
mso-font-signature:1 134676480 16 0 131072 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
h2
{mso-style-next:Normal;
margin-top:12.0pt;
margin-right:0in;
margin-bottom:3.0pt;
margin-left:0in;
mso-pagination:widow-orphan;
page-break-after:avoid;
mso-outline-level:2;
font-size:14.0pt;
font-family:Arial;
mso-fareast-font-family:"MS Mincho";
font-weight:bold;
font-style:italic;}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;
text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
{color:blue;
text-decoration:underline;
text-underline:single;}
p
{mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
/* List Definitions */
@list l0
{mso-list-id:674840541;
mso-list-template-ids:-2124219552;}
@list l0:level1
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l1
{mso-list-id:2089955430;
mso-list-template-ids:282387748;}
@list l1:level1
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
-->
</style><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</style>
<![endif]--><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="6146"/>
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1"/>
</o:shapelayout></xml><![endif]--></head>
<body style="" lang="EN-US" link="blue" vlink="blue">
<div class="Section1">
<p class="MsoNormal"><span style="font-family: Arial;"><br>
</span><a href="../../../DOC/Others/FWLib/CHM_Generator/Library_html/index.html"></a><span style="font-family: Arial;"><o:p></o:p></span></p>
<div align="center">
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
<tbody><tr style="">
<td style="padding: 0in;" valign="top">
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
<tbody><tr style="">
<td style="padding: 1.5pt;">
<h1 style="margin-bottom: 0.25in; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release Notes
for STM32F107 LwIP demonstration package </span></h1>
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright ? 2009
STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img id="_x0000_i1025" src="_htmresc/logo.bmp" style="border-style: solid; border-width: 0px; height: 65px; width: 86px;" border="0" height="65" width="86"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
</td>
</tr>
</tbody></table>
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p>&nbsp;</o:p></span></p>
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" width="900">
<tbody><tr style="">
<td style="padding: 0in;" valign="top">
<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><span style="font-size: 12pt; color: white;">STM32F107 LwIP demonstration package History<o:p></o:p></span></h2>
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 558.05pt;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0 - 11/20/2009<o:p></o:p></span></h3>
<ul style="margin-top: 0in;" type="square">
<li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-size: 10pt; font-family: Verdana;">Created.</span></li><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-size: 10pt; font-family: Verdana;">This demonstration firmware is&nbsp;provided and has been tested with the following toolchains:<br></span></li><ul><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-size: 10pt; font-family: Verdana;">EWARM v5.42 (from&nbsp;</span><span style="font-size: 10pt; font-family: Verdana;">IAR)</span></li><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-size: 10pt; font-family: Verdana;">ARM-MDK v3.80a (from </span><span style="font-size: 10pt; font-family: Verdana;">Keil)</span></li><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-size: 10pt; font-family: Verdana;">RIDE v7.24 &amp; Rkit ARM v1.22.09.0254 (</span><span style="font-size: 10pt; font-family: Verdana;">from Raisonance)</span></li><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-size: 10pt; font-family: Verdana;">HiTOP v5.31 (</span><span style="font-size: 10pt; font-family: Verdana;">from Hitex)</span></li></ul>
</ul>
<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><span style="font-size: 12pt; color: white;">License<o:p></o:p></span></h2>
<p class="MsoNormal" style="margin: 4.5pt 0in;"><span style="font-size: 10pt; font-family: Verdana; color: black;">The enclosed firmware and all the related documentation are
not covered by a License Agreement, if you need such License you can
contact your local STMicroelectronics office.<u1:p></u1:p><o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-size: 10pt; font-family: Verdana; color: black;">THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT
PROVIDING CUSTOMERS WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN
ORDER FOR THEM TO SAVE TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE
HELD LIABLE FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT
TO ANY CLAIMS ARISING FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE
BY CUSTOMERS OF THE CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH
THEIR PRODUCTS. <o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="color: black;"><o:p>&nbsp;</o:p></span></p>
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
<hr align="center" size="2" width="100%">
</span></div>
<p class="MsoNormal" style="margin: 4.5pt 0in 4.5pt 0.25in; text-align: center;" align="center"><span style="font-size: 10pt; font-family: Verdana; color: black;">For Complete on </span><span style="font-size: 10pt; font-family: Verdana;">STM32(<span style="color: black;">CORTEX
M3) 32-Bit Microcontrollers visit </span><u><span style="color: blue;"><a href="http://www.st.com/stm32" target="_blank">www.st.com/STM32</a></span></u></span><span style="color: black;"><o:p></o:p></span></p>
</td>
</tr>
</tbody></table>
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
</td>
</tr>
</tbody></table>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</body></html>


回复 支持 反对

使用道具 举报

1

主题

24

帖子

0

精华

初级会员

Rank: 2

积分
74
金钱
74
注册时间
2014-12-5
在线时间
6 小时
发表于 2015-6-25 16:48:53 | 显示全部楼层
回复【2楼】正点原子:
---------------------------------
原子大哥,我想请问一下,例程里面服务器是怎么和网页交互的,比如按一下按钮,怎么向服务器发信息,并且服务器怎么区分是第几个按钮?
回复 支持 反对

使用道具 举报

1

主题

24

帖子

0

精华

初级会员

Rank: 2

积分
74
金钱
74
注册时间
2014-12-5
在线时间
6 小时
发表于 2015-6-25 17:45:50 | 显示全部楼层
回复【3楼】正点原子:
---------------------------------
按一下按键 怎么让网页向服务器发送一个GET请求?
回复 支持 反对

使用道具 举报

4

主题

56

帖子

0

精华

初级会员

Rank: 2

积分
129
金钱
129
注册时间
2015-3-9
在线时间
9 小时
发表于 2015-6-25 20:49:05 | 显示全部楼层
你打开一个网页,服务器就给你发个html文档

然后你的浏览器就会把这个文档解析,就显示出来了...


html是一种标记语言,按照一定的格式编写的文本文档而已
来来,我是一个白菜,菜菜菜。。。。。
回复 支持 反对

使用道具 举报

22

主题

751

帖子

0

精华

金牌会员

Rank: 6Rank: 6

积分
1606
金钱
1606
注册时间
2015-6-10
在线时间
223 小时
发表于 2015-6-26 16:17:13 | 显示全部楼层
用python  抄袭树莓派的代码就可以
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-6-20 22:59

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表