今天完成的功能:
1.网站,php的大概框架,config等公共文件的设置,php页面的基本架构
2.用户注册,登陆,信息的修改
今天学会了:
1.验证码
2.cookies和session
感觉上今天还算可以的,如果不是那个cookies浪费我了3个小时,我想进度应该还会快点.
经验与心得:
在setcookies()时,前面不能有任何的输出语句;包括include文件最低下的空行(今天就是被它浪费了我3小时:()
posted @
2006-01-03 01:10 豪 阅读(228) |
评论 (0) |
编辑 收藏
先把最基本的生成静态文件的类写了,该类能根据时间,由客户端生成.!
请大家帮忙指出错误!
好困,先睡了^_^
/*************
| +-------------------------------------------------
| Id:
| +-------------------------------------------------
| Copyright (c)
| Author: qywyh_scut@163.com
| +-------------------------------------------------
| Create Date: 2006-1-1 2:58
| Modify Date:
| Note: Using Method:
$t=new myStaticFile($filename,10);
$t->StaticFile($content);
|
|
| +-------------------------------------------------
***************/
class myStaticFile
{
var $filename;
var $Statictime;
function myStaticFile($f,$p,$s=15)
{
$this->filename=$p.$f.".htm";
$this->Statictime=$s;
if(file_exists($this->filename))
{
$fOldTime=filemtime($this->filename);
if($fOldTime>time()-$this->Statictime)
{
$this->go_url();
exit;
}
}
}
![](/Images/OutliningIndicators/None.gif)
function go_url($second=0)
{
![](/Images/OutliningIndicators/None.gif)
echo "<META http-equiv=Pragma content=no-cache><META http-equiv=Cache-Control content=no-cache><META http-equiv=Expires content=0><META HTTP-EQUIV=REFRESH CONTENT=$second;URL=$this->filename>";
exit;
}
![](/Images/OutliningIndicators/None.gif)
function wfile($content,$mode='w')
{
if(file_exists($this->filename))
{
chmod($this->filename,0777);
}
$fp = fopen($this->filename, $mode);
if (!$fp) return false;
fwrite($fp,$content);
chmod($this->filename,0755);
fclose($fp);
return true;
}
![](/Images/OutliningIndicators/None.gif)
function StaticFile($content)
{
if($this->Statictime==0)
{
echo $content;
exit;
}
$f=$this->wfile($content);
if(!$f)
{
echo "生成静态文件失败";
return false;
}
$this->go_url();
exit;
}
}
posted @
2006-01-01 03:05 豪 阅读(358) |
评论 (1) |
编辑 收藏
今天已经把网站的布局结构的html交了上去,标志着自己的第一个独立的项目正式展开~~~~~
以下是接下来需要完成的功能:
1. 用户功能; (注册,登陆,后台管理)
2. 网站功能; (发布信息,网站首页,查看地区,查看行业,搜索, 后台信息管理) ;
3. 页面整合,留言版,浏览用户留言; 4. 其它美工类型的页面整合;
前面两个阶段由于工作量主要集中在这里,花费时间比较多,所以希望在年前完成,
后两个阶段主要是其它页面及功能,和美工的一些整合,时间可以比较宽松.
并且在后面两个阶段修改一下用户功能及网站功能;
posted @
2006-01-01 00:06 豪 阅读(326) |
评论 (0) |
编辑 收藏
书上说,当无法列出传递函数的所有实参的类型和数目时,可用省略号指定参数表
(...)
如:void foo(...);
void foo(parm_list,...);
void foo(...)
{
//...
}
调用:foo(a,b,c);
就是不懂,把a,b,c的值传进函数里面后,用什么变量来接收???如果不能接收,(...)岂不是没意义?
还有就是不明白
int printf(const char*...);
printf("hello,&s\n",userName);
这个c的输出函数是怎么用(...)实现的.
先谢了:)
posted @
2005-12-30 00:21 豪 阅读(2906) |
评论 (14) |
编辑 收藏
知道写的很烂,发上来时希望各位兄台指点不足:)
先谢啦,呵呵.
#include<iostream>
using namespace std;
![](/Images/OutliningIndicators/None.gif)
struct date
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/ContractedBlock.gif)
{
unsigned int year,month,day;
};
![](/Images/OutliningIndicators/None.gif)
unsigned int sum(unsigned int,unsigned int,unsigned int);
bool is_eyear(unsigned int);
![](/Images/OutliningIndicators/None.gif)
void main()
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/ContractedBlock.gif)
{
date temp;
unsigned int total;
cout<<"please input date,formation:2005 12 05"<<endl;
cin>>temp.year>>temp.month>>temp.day;
total=sum(temp.year,temp.month,temp.day);
cout<<"total day="<<total<<endl;
}
![](/Images/OutliningIndicators/None.gif)
unsigned int sum(unsigned int y,unsigned int m,unsigned int d)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/ContractedBlock.gif)
{
unsigned int t=0;
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
if(m<1)
{
t=0;
return t;
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
}else if(m==1)
{
t=d;
return t;
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
}else
{
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
switch(m)
{
case 3:
if(is_eyear(y))
t=d+sum(y,m-1,29);
else t=d+sum(y,m-1,28);
break;
case 2:case 4:case 6:case 8:case 9:case 11:
t=d+sum(y,m-1,31);
break;
default :
t=d+sum(y,m-1,30);
break;
}
}
return t;
}//计算日期总数函数
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
/**//***************
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
bool is_eyear(unsigned int y)
{
if(y%400==0) return 1;
else if(y%4==0) return 1;
else return 0;
}//判断闰年函数
**************/
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
bool is_eyear(unsigned int y)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/ContractedBlock.gif)
{
if(y%100==0&&y%400==0) return 1;
if(y%100!=0&&y%4==0) return 1;
return 0;
}//判断闰年函数
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
posted @
2005-12-28 23:12 豪 阅读(917) |
评论 (6) |
编辑 收藏