PHP 连接mysql
<?
$_mysqlhost="localhost";
$_mysqluser="root";
$_mysqlpass="";
$_mysqldata="mydata";
$_connect=mysql_connect($_mysqlhost,$_mysqluser,$_mysqlpass) or die ("错误".mysql_error());
mysql_query("SET character_set_connection=utf8, character_set_results=utf8, character_set_client=binary", $connect);
mysql_query("SET SQL_MODE = ''", $connect);
mysql_select_db(mysqldata) or die("没有查找到(".$mysqldata."这个表),错误:".mysql_error());
?>
相关文档:
工作中用到,自己写了一个,分享给有需要的人,前面是类定义,后面2行是调用。
优点:
不需要外部图片
支持PNG透明
可自定义圆角半径
不足:
只能指定一种透明色
<?php
class RoundedCorner {
private $_r;
private $_g;
private $_b;
private $_image_path;
private $_radius;
function _ ......
openpne开源SNS
用PHP模拟126邮箱的登陆过程来收取邮件:http://www.cnblogs.com/amboyna/archive/2009/04/29/1446487.html
php调用其他系统的接口整理:http://blog.chinaunix.net/u2/84280/showart_2065156.html
问题:我是想写一个网上给手机发短信的功能 调用了一个第三方的飞信接口
飞信接口PHP版 (免费发短信) v1. ......
<?php
/*使用文本文件记录数据的简单实现*/
$counter=1;
if(file_exists("mycounter.txt")){
$fp=fopen("mycounter.txt","r");
$counter=fgets($fp,9);
$counter++;
fclose($fp);
}
$fp=fopen("mycounter.txt","w");
fputs($fp,$counter);
fclose($fp);
echo "<h1>您是第".$counter."次访问本页 ......
include实现国际化
将index.php进行翻译:
Index内容
1. Index
2. About us
我们可以将index.php设置为一个翻译模版,所有出现字符的地方,都定义为变量,如1,2部分设置为翻译的变量$menu_index, $menu_aboutus.
......