//mssql server与php连接
//mysql数据库连接
//mssql server与php连接
//mysql数据库连接
$host = 'localhost';
$user_name = 'root';
$password = 'admin';
$conn = mysql_connect($host,$user_name,$password);
if(!$conn)
{
die('数据库连接失败:'.mysql_error());
}
mysql_select_db('test');
?>
<b>提交用户信息</b>
$host = 'localhost';
$user_name = 'root';
$password = 'admin';
$id = $_get['id'];
$conn = mysql教程_connect($host,$user_name,$password);
if(!$conn)
{
die('数据库连接失败:'.mysql_error());
}
mysql_select_db('test');
$host = 'localhost';
$user_name = 'root';
$password = 'admin';
$conn = mysql_connect($host,$user_name,$password);
if(!$conn)
{
die('数据库连接失败:<br/>'.mysql_error());
}
echo '数据库连接成功!继续操作...';
post.php 读文件并显示日志内容的php程序。
page.html 显示日志文章的html文档。
style.css教程 页面显示效果的css代码。
add.php 添加blog文章的php程序。
config/auth.php 用户名和密码配置文件。
index.php blog首页程序。
edit.php 编辑blog文章的程序。
delete.php 删除blog文章的程序。
archives.php 归档显示blog文章的程序。
logout.php 退出登录的程序。
class getmacaddr
{
var $return_array = array(); // 返回带有mac地址的字串数组
var $mac_addr;
function getmacaddr($os_type)
{
switch ( strtolower($os_type) )
{
case "linux":
$this->forlinux();
break;
case "solaris":
break;
case "unix":
break;
case "aix":
break;
default:
$this->forwindows();
break;
}
$temp_array = array();
foreach ( $this->return_array as $value )
{
if ( preg_match( "/[0-9a-f][0-9a-f][:-]"."[0-9a-f][0-9a-f][:-]"."[0-9a-f][0-9a-f][:-]"."[0-9a-f][0-9a-f][:-]"."[0-9a-f][0-9a-f][:-]"."[0-9a-f][0-9a-f]/i", $value, $temp_array ) )
{
$this->mac_addr = $temp_array[0];
break;
}
}
unset($temp_array);
return $this->mac_addr;
}
//最简单的方法
//最实用获取用户ip地址代码
//获取文件的主要信息。
$file = "data.txt";
if(is_dir($file))
{
echo "文件 $file 是个目录";
echo "<br/>";
}
else
{
echo "文件 $file 不是目录";
echo "<br/>";
}
文本有下面标签
<img style src="<?=$url?>/images/styleno.jpg" width="30" height="30" />
<img style src="<?=$url?>/images/styleno.jpg" width="30" height="30" />
<img src="images/styleno.jpg" width="30" height="30" />
<img src="images/styleno.jpg" width="30" height="30" />
想用正则把他们替换成
有 style的 替换成<img src="<?=$url?>/images/styleno.jpg" width="30" height="30" />
没style 的 替换成<img src="<?=$path?>/images/styleno.jpg" width="30" height="30" />
$dir = "d: iles";
$file_list1 = scandir($dir);
//向函数scandir传入第2个参数,如果第2个参数为1,表示按字母降序排列文件名
$file_list2 = scandir($dir,1);