PHP 无限分类
<?php
//作者:梁文平 http://www.tyasp.net
session_start();
if($_SESSION["username"]!="admin")
{
echo("<mce:script type="text/javascript"><!--
alert("操作超时!请重新登陆...");window.location.href="../index.php";
// --></mce:script>");
//header("refresh:0;url=../");
exit();
}
include("../../include/include.php");
$simple=new simple_gb;
$simple->linkdb($host,$user,$password,$db);
if($_GET["action"]=="submit")
{
$result=mysql_query("select max(ClassId)+1 as aa from newsclass");
$row=mysql_fetch_array($result);
$sql="insert into newsclass (ClassId,ClassDesc,ParentId) values("". $row["aa"] ."","". $_POST["txtClassDesc"] ."","". $_POST["dropParentId"] ."")";
mysql_query($sql);
echo("提交成功!");
exit();
}
/*
$sql="insert into news (newstitle,content,savedate) values("a","b","". date("Y-m-d H:i:s") ."")";
mysql_query($sql,$simple->con);
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF8" />
<title></title>
</head>
<body>
<link href="../Admin_Style.css" mce_href="Admin_Style.css" rel="stylesheet" type="text/css" />
<form id="form1" name="form1" method="post" action="?action=submit">
<table width="427" border="0" align="center" cellpadding="4" cellspacing="0">
<tr>
<td width="58">类别名:</td>
<td width="353"><label>
<input name="txtClassDesc" type="text" id="txtClassDesc" />
</label></td>
</tr>
<tr>
<td>父 类:</td>
<td><label>
<select name="dropParentId" id="dropParentId">
<option value="0">根目录</option>
<?php
$result=@mysql_query("sel
相关文档:
一个非常简单的PHP生成缩略图的代码程序,参数及代码都算得上精简,有兴趣的朋友可以试下它的功能,有不太完善的地方还请指正。 非原创,来自网络
<?$FILENAME="image_name";
// 生成图片的宽度
$RESIZEWIDTH=400;
// 生成图片的高度
$RESIZEHEIGHT=400;
function ResizeImage($im,$maxwidth,$maxheight,$name){ ......
在新安装好的mysql ,apahce,php 的时候,如果在代码中使用了sessions_start() 的时候会出现类似以下的错误:
Warning: session_start() [function.session-start]: Cannot send session cooki 等的错误。
请安装如下的思路去修正:
1.在php.ini 中配置 session.savepath='/tmp'
2.开启session.auto_start=1
3.把更改 ......
伪静态用到知识很简单一旦学会,快乐无穷,只需要正则和服务器设置。
先说iis如何设置吧,往下看
下载(IIS Rewrite模块): http://www.isapirewrite.com/,先把产品下载下来,安装在服务器上,记住目录,会有类似Rewrite.dll的文件生成,MMC→IIS信息服务管理器→网站→您的站点→属性,在“ ......
<?php
//״ͼ
//http://www.codefans.net
//
function createImage($data,$twidth,$tspace,$height){
$dataName = array();
&nb ......
今天确实是无聊了,写了一个备份人人网的日志,到本地html的类。
主要是cURL登录,正则解析页面。
使用方法,最后那个脚本的最后两行改掉,你知道的。或者重新写一个运行脚本:
<?php
include("renren.php");
$test = new renren("你的人人网账号","你的人人网密码");
$test->do ......