首页 > php开发

php svn操作类

以前我们开发大型项目时都会用到svn来同步,因为开发产品的人过多,所以我们会利用软件来管理,今天发有一居然可以利用php来管理svn哦,好了看看吧。  代码如下 复制代码 <?php/**** This class for execute the external program of svn** @auth Seven Yang http://www.phprm.com**/class SvnPeer{/*** List directory entries in the repository** @param s...
阅读全文

php ubb代码解析程序

/**
+----------------------------------------------------------
* UBB 解析
+----------------------------------------------------------
* @return string
+----------------------------------------------------------
*/
function ubb($Text) {
$Text=trim($Text);
$Text=ereg_replace("n","<br>",$Text);
$Text=preg_replace("/t/is"," ",$Text);
$Text=preg_replace("/[hr]/is","<hr>",$Text);
$Text=preg_replace("/[separator]/is","<br/>",$Text);
$Text=preg_replace("/[h1](.+?)[/h1]/is","<h1>1</h1>",$Text);
$Text=preg_replace("/[h2](.+?)[/h2]/is","<h2>1</h2>",$Text);
$Text=preg_replace("/[h3](.+?)[/h3]/is","<h3>1</h3>",$Text);
$Text=preg_replace("/[h4](.+?)[/h4]/is","<h4>1</h4>",$Text);
$Text=preg_replace("/[h5](.+?)[/h5]/is","<h5>1</h5>",$Text);
$Text=preg_replace("/[h6](.+?)[/h6]/is","<h6>1</h6>",$Text);
$Text=preg_replace("/[center](.+?)[/center]/is","<center>1</center>",$Text);
//$Text=preg_replace("/[url=([^[]*)](.+?)[/url]/is","<a href=1 target='_blank'>2</a>",$Text);
$Text=preg_replace("/[url](.+?)[/url]/is","<a href="1" target='_blank'>1</a>",$Text);
$Text=preg_replace("/[url=(http://.+?)](.+?)[/url]/is","<a href='1' target='_blank'>2</a>",$Text);
$Text=preg_replace("/[url=(.+?)](.+?)[/url]/is","<a href=1>2</a>",$Text);
$Text=preg_replace("/[img](.+?)[/img]/is","<img src=1>",$Text);
$Text=preg_replace("/[imgs(.+?)](.+?)[/img]/is","<img 1 src=2>",$Text);
$Text=preg_replace("/[color=(.+?)](.+?)[/color]/is","<font color=1>2</font>",$Text);
$Text=preg_replace("/[colorTxt](.+?)[/colorTxt]/eis","color_txt('1')",$Text);
$Text=preg_replace("/[style=(.+?)](.+?)[/style]/is","<div class='1'>2</div>",$Text);
$Text=preg_replace("/[size=(.+?)](.+?)[/size]/is","<font size=1>2</font>",$Text);
$Text=preg_replace("/[sup](.+?)[/sup]/is","<sup>1</sup>",$Text);
$Text=preg_replace("/[sub](.+?)[/sub]/is","<sub>1</sub>",$Text);
$Text=preg_replace("/[pre](.+?)[/pre]/is","<pre>1</pre>",$Text);
$Text=preg_replace("/[emot](.+?)[/emot]/eis","emot('1')",$Text);
$Text=preg_replace("/[email](.+?)[/email]/is","<a href='mailto:1'>1</a>",$Text);
$Text=preg_replace("/[i](.+?)[/i]/is","<i>1</i>",$Text);
$Text=preg_replace("/[u](.+?)[/u]/is","<u>1</u>",$Text);
$Text=preg_replace("/[b](.+?)[/b]/is","<b>1</b>",$Text);
$Text=preg_replace("/[quote](.+?)[/quote]/is","<blockquote>引用:<div style='border:1px solid silver;background:#EFFFDF;color:#393939;padding:5px' >1</div></blockquote>", $Text);
$Text=preg_replace("/[code](.+?)[/code]/eis","highlight_code('1')", $Text);
$Text=preg_replace("/[php](.+?)[/php]/eis","highlight_code('1')", $Text);
$Text=preg_replace("/[sig](.+?)[/sig]/is","<div style='text-align: left; color: darkgreen; margin-left: 5%'><br><br>--------------------------<br>1<br>--------------------------</div>", $Text);
return $Text;
}

阅读全文

php留言板的设计构思

-设计一个程序流程
       1.功能需要
       2.页面设计
       3.数据库设计
       4.代码设计
       5.调试发布
   -表单
       1.form></form>
       2.method:表单数据传输到服务器的方法
          post(表示在Http请求中嵌入表单数据)
          get   (表示将表单数据附加到请求该页的URL)  默认方法
          区别:
          a.Get传输数据量小,这主要是受URL长度限制;而Post可以传输大量数据。
          b.Get安全性比较低,但执行效率比Post好。      
          接收参数:
          POST方式:$_POST['name']
          GET方式:$_GET['name']
          注意:$_POST与$_GET必须为大写;
                     php5.0以上版本不加引号会报notice级别错误,要养成良好书写习惯,规范化。当然关闭display_error就另当别论。
         充电
          $_POST:它是由HTTP POST方法传递的变量组成的数组
          $_GET: 它是由HTTP GET方法传递的变量组成的数组
          $_COOKIE:它是由HTTP Cookies传递的变量组成的数组
          $_SESSION:它是包含当前脚本中会话变量的数组
          建议
          1.GET安全性较POST差,包含机密信息的话建议使用POST
          2.分页时使用GET
       3.常用控件
           a.单行文本框   <input type=text>
               多行文本框  <textarea></textarea>
           b.密码框   <input type=password>
           c.多选框   <input type=checkbox checked> (checked属性表示选中状态)
           d.单选框   <input type=radio checked> (checked同上)
           e.下拉菜单
               <select>
               <option selected></option>     //selected指定该选项的初始状态为选中
               </select>
            f.提交按钮 <input type=submit>
              重置按钮  <input type=reset>
        4.日期/时间函数
            php:date,time;
            mysql:now
   -javascript验证
       onsubmit:当提交按钮点击时触动,如果内容为"return function_name();"函数返回FALSE,则不提交表单。
   -初识COOKIE
        setcookie(name,value,time);
        注意:php的cookie必须刷新一次才能生效。

阅读全文

php开发必须分页代码

在开发中这个分页功能肯定是少不了的,今天我们分享一个非常实用且简单的php分页功能的实现代码,有需要的朋友可以参考一下。  代码如下 复制代码 /*** 分页函数** @param int $count 条目总数* @param int $perlogs 每页显示条数目* @param int $page 当前页码* @param string $url 页码的地址*/function pagination($count,$perlogs,$page,$url,$anchor=''){$pnums = @ceil($count /...
阅读全文