第一个php网页
<?php
date_default_timezone_set('PRC');
if($_POST[ok])
{
//echo "记录";
//echo "here";
$link_id=mysql_connect("127.0.0.1","root","yc9413") or die("failed to connect!");
if($link_id)
{
//echo "success to connect<br />";
//
mysql_select_db("_blog");
$query_test="select *from _blog_";
$result_q=mysql_query($query_test);
$row=mysql_fetch_array($result_q); //echo $row[txt];
//echo "<br />"; $sql="insert into _blog_ values('".$_POST[newtxt]."','".date('Y-m-d H:i:s',time())."')";
$result=mysql_query($sql);
if($result)
{
echo '<html><head><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /><meta name="viewport" content="width=device-width, initial-scale=1" /><meta http-equiv="Content-Type" charset="UTF-8" /><meta name="google" content="notranslate" /><title>LeMon | 落星</title><meta name="keywords" content="blog,素材,旅行,电影" /><meta name="description" content="无话和不说,我的两大优点.." /><link rel="stylesheet" href="_css/_index_style.css" /><script type="text/javascript" src="../_js/jquery.js"></script><script type="text/javascript" src="_js/jquery.js"></script><script type="text/javascript" src="_js/_index.js"></script><style></style></head><body class="first_page" id="body_page"><div class="show_pan" id="sp"><h1 id="h01" >Hello LeMon</h1><div id="nt" class="new_txt"><div id="it" class="new_input_txt"><form method="post" action="index.php"><textarea class="new_stuff" id="ns" name="newtxt"></textarea><input type=submit name=ok value="提交" id="put_new_txt" /></form></div></div></div></body></html>'; }else
{
echo "failed to insert";
mysql_close($link_id);
} } }else
{
?>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="Content-Type" charset="UTF-8" />
<meta name="google" content="notranslate" />
<title>LeMon | 落星</title>
<meta name="keywords" content="blog,素材,旅行,电影" />
<meta name="description" content="无话和不说,我的两大优点.." />
<link rel="stylesheet" href="_css/_index_style.css" />
<script type="text/javascript" src="../_js/jquery.js"></script>
<script type="text/javascript" src="_js/jquery.js"></script>
<script type="text/javascript" src="_js/_index.js"></script>
<style> </style>
</head>
<body class="first_page" id="body_page">
<div class="show_pan" id="sp">
<h1 id="h01" >Hello LeMon</h1>
<div id="nt" class="new_txt">
<div id="it" class="new_input_txt">
<form method="post" action="index.php">
<textarea class="new_stuff" id="ns" name="newtxt"> </textarea>
<input type=submit name=ok value="提交" id="put_new_txt" />
</form>
</div>
</div>
</div>
</body>
</html>
<?
} ?>
第一个php网页的更多相关文章
- 用 python 实现一个多线程网页下载器
今天上来分享一下昨天实现的一个多线程网页下载器. 这是一个有着真实需求的实现,我的用途是拿它来通过 HTTP 方式向服务器提交游戏数据.把它放上来也是想大家帮忙挑刺,找找 bug,让它工作得更好. k ...
- 设置一个div网页滚动时,使其固定在头部,当页面滚动到距离头部300px时,隐藏该div,另一个div在底部,此时显示;当页面滚动到起始位置时,头部div出现,底部div隐藏
设置一个div网页滚动时,使其固定在头部,当页面滚动到距离头部300px时,隐藏该div,另一个div在底部,此时显示: 当页面滚动到起始位置时,头部div出现,底部div隐藏 前端代码: <! ...
- javascript一个在网页上画线的库
文章;安利一个绘制指引线的JS库leader-line 一个在网页上划线的库感觉很不错.
- 10分钟搭建一个小型网页(python django)(hello world!)
10分钟搭建一个小型网页(python django)(hello world!) 1.安装django pip install django 安装成功后,在Scripts目录下存在django-ad ...
- bootstrap开发一个简单网页。
CSS代码: body{ padding-top: 50px; padding-bottom: 50px; overflow: auto!important; ...
- 实现一个自适应网页用到的css知识
1 div导致父级高度没有变化是应该子元素设置了float:left等 2 div元素居中 text-align:center; margin-left: auto;margin-right: 3 大 ...
- 分享一个刷网页PV的python小脚本
下面分享一个小脚本,用来刷网页PV. [root@huanqiu ~]# cat www.py #!/usr/bin/python# coding: UTF-8import webbrowser as ...
- CSS制作一个简单网页的下拉导航栏
网页下拉导航栏的制作 网页下拉导航栏的制作很简单,只需要运用好CSS中伪选择器. 首先说明几个简单的伪选择器(比较常用的): link:连接平常的状态 visited:连接被访问过之后 hover:鼠 ...
- 一个检测网页是否有日常链接的python脚本
在大的互联网公司干技术的基本都会碰到测试.预发布.线上这种多套环境的,来实现测试和线上正式环境的隔离,这种情况下,就难免会碰到秀逗了把测试的链接发布到线上的情况,一般这种都是通过一些测试的检查工具来检 ...
- 课时10.第一个HTML网页(掌握)
网页的固定格式 编写网页和写信一样都有一套规范和要求,这套规范和要求中规定了写信的固定格式 写信基本结构 亲爱的xx: 你好! 我.................. ...... 此致 敬礼! xx ...
随机推荐
- UIScrollView解决touchesBegan等方法不能触发的解方案
新建一个类继承自UIScrollView 并重写下面的方法 -(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ [su ...
- android开发两种退出程序方式(killProcess,System.exit)
KillProcess: 在android中我们如果想要程序的进程结束可以这样写: android.os.Process.killProcess(android.os.Process.myPid()) ...
- initialize or clean up your unittest within .net unit test
// Use ClassInitialize to run code before running the first test in the class [ClassInitialize()] pu ...
- 一些常用的jQuery插件
1. X-editable 这个插件能够让你在页面上创建可编辑的元素.它能够使用任何引擎(bootstrap.jquery-ui.jquery),并且包含弹出式和内联模式. 2. Garlic.js ...
- android fragment嵌套fragment出现的问题:no activity
package com.example.fragmentNavigation2.fragment; import android.content.Context; import android.os. ...
- CoreData的简单使用(二)数据的增删改查,轻量级的版本迁移
上一篇中我们已经使用CoreData创建了一个SQLite数据库 CoreData的简单使用(一)数据库的创建 现在对数据库进行数据的CRUD(增删改查) 1.Data Model 的设置 创建一个D ...
- Java调用存储过程时报 The user specified as a definer ('root'@'%') does not exist 解决方法
Caused by: java.sql.SQLException: The user specified as a definer (''@'') does not exist at c ...
- C++ sizeof的使用总结
说明:以下代码在VS2008中通过,在32位操作系统下. 1. 定义 sizeof是一个操作符(operator). 其作用是返回一个对象或类型所占的内存字节数. 其返回值类型为size_t ...
- yii 验证器和验证码
http://www.yiiframework.com/doc/api/1.1/CCaptcha http://www.cnblogs.com/analyzer/articles/1673015.ht ...
- linux下查看防火墙当前状态,开启关闭等
从配置菜单关闭防火墙是不起作用的,索性在安装的时候就不要装防火墙 查看防火墙状态: /etc/init.d/iptables status 暂时关闭防火墙: /etc/init.d/iptables ...