第一个php程序,留言板
一波三折啊,老是忘记打单词
<body bgcolor="#0080FF"" >
<form action="bbs.php" method="post" name="Form">
<table border=0 cellpadding=2 cellspacing=0 >
<tr>
<td align=right>名字:</td>
<td><input type=text size=40 name=Ename value='' maxlength=50 ></td></tr>
<tr>
<td align=right>Email:</td><td><input type=text size=40 name=email value='' maxlength=100 ></td>
</tr>
<tr>
<td valign=top align=right>留言:</td>
<td><textarea name=content rows=4 cols=40 wrap=virtual></textarea></td>
</tr>
<tr>
<td> </td><td><div align="center">
<input type=submit value='添加'>
<input type=reset value='清除'>
</div>
</td>
</tr>
<tr>
<td></td>
<td> </td>
</tr>
</table>
<br>
<?php
//连接数据库
$link=mysql_connect('localhost' , 'root' , '');
if (!$link)
{
die('Could not connect:'.mysql_error());
}
mysql_select_db("bbs");
//判断姓名是否为空
if(!empty($_POST['Ename']))
{
$Ename=($_POST['Ename']);
$email=($_POST['email']);
$content=($_POST['content']); //content就是内容的意思
$PostDate=getdate();
//定义数据到bbs表的SQL字符串
$SQL="insert into bbs(Ename,email,content,postDate) values('$Ename','$email','$content',Now());";
//执行插入语句
mysql
相关文档:
其实这个的主要部分并不是一个jquery,但是必须使用到
php程序部分,也只需要这个一个php程序就可以了
www.corange.cn亲测
<?php
header("Content-Type: text/html; charset=utf-8");
@header( "Cache-Control: no-cache, must-revalidate" );
@header( "Pragma: no-cache" );
@header( "Last-Modified: " ......
呵呵,翻译了篇东西,N长时间没用英语了,出了丑大家可一定要指出来啊。翻译自:Nick Halstead's Blog
A friend recently got some pre-interview questions from YAHOO for a PHP
job. Following up my previous post about programmer questions I
thought I would post them to give people examples of what a ......
PHP面向对象分析设计的61条军规
你不必严格遵守这些原则,违背它们也不会被处以宗教刑罚。但你应当把这些原则看成警铃,若违背了其中的一条,那么警铃就会响起 。 ----- Arthur J.Riel
(1)所有数据都应该隐藏在所在的类的内部。
(2)类的使用者必须依赖类的共有接口,但类不能依赖它的使用者。
(3)尽量减少类的协议中 ......
【1】页面之间无法传递变量 get,post,session在最新的php版本中自动全局变量是关闭的,所以要从上一页面取得提
交过来得变量要使用$_GET['foo'],$_POST['foo'],$_SESSION['foo']来得到。当然也可以修改自动全局变量为开
(php.ini改为register_globals = On);考虑到兼容性,还是强迫自己熟悉新的写法比较好。
【2 ......
由于最近在与SP合作,开发手机业务下载,数据提交采用POST方式提交,现与大家分亨比较成熟类.
function uc_api_post($url, $action, $sendmsg='') {
$postdata = "corpMsg=$sendmsg";
return uc_fopen(UC_URL, 500000, $postdata, '', TRUE, UC_IP, 20);
}
function uc_fopen($url, $limit = 0, $post = '', $cookie = ......