source: pmb4.2/trunk/fuentes/pmb/includes/cms/cms.inc.php @ 819

Last change on this file since 819 was 815, checked in by jrpelegrina, 4 years ago

Initial release of pmb 4.2

  • Property svn:executable set to *
File size: 919 bytes
Line 
1<?php
2// +-------------------------------------------------+
3// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
4// +-------------------------------------------------+
5// $Id: cms.inc.php,v 1.3 2015-04-03 11:16:29 jpermanne Exp $
6
7if (stristr($_SERVER['REQUEST_URI'], "tpl.php")) die("no access");
8
9function cms_hash_new($table_name,$id=''){
10        $new=false;
11        while(!$new){
12                $hash_tmp = md5($table_name.$id.time());
13                $new=cms_hash_exist($hash_tmp);
14                if(!$new){                     
15                        $req = "insert into cms_hash set hash ='$hash_tmp' ";
16                        pmb_mysql_query($req);
17                }
18        }
19        return $hash_tmp;
20}
21
22function cms_hash_exist($hash){ 
23        $rqt = "select * from cms_hash where hash ='$hash' ";
24        $res = pmb_mysql_query($rqt);
25        if(pmb_mysql_num_rows($res)){
26                return true;
27        }       
28        return false;
29}
30
31function cms_hash_del($hash){   
32        $rqt = "delete from cms_hash where hash ='$hash' ";
33        $res = pmb_mysql_query($rqt);
34}
Note: See TracBrowser for help on using the repository browser.