: This article describes how to create a coupon code for PHPTHINKPHP. if you are interested in the PHP Tutorial, refer to it.
model = getModelByName ('coupon'); $this->model || $this->error ( 'model is not found!' ); } /* * Create coupon code * * @param $namespace string * @return $guid string * @author sun */privatefunctioncreate_guid($namespace = '') {static$guid = ''; $uid = uniqid("", true); $data = $namespace; $data .= $_SERVER['REQUEST_TIME']; $data .= $_SERVER['HTTP_USER_AGENT']; $data .= $_SERVER['LOCAL_ADDR']; $data .= $_SERVER['LOCAL_PORT']; $data .= $_SERVER['REMOTE_ADDR']; $data .= $_SERVER['REMOTE_PORT']; $hash = strtoupper(hash('ripemd128', $uid . $guid . md5($data))); // test str combination$guid = substr($hash, 0, 6) . '-' . substr($hash, 8, 4) . '-' . substr($hash, 12, 4) . '-' . substr($hash, 16, 4) . '-' . substr($hash, 20, 8); return$guid; }}// end
'). AddClass ('pre-numbering '). hide (); $ (this ). addClass ('Has-numbering '). parent (). append ($ numbering); for (I = 1; I <= lines; I ++) {$ numbering. append ($ ('
'). Text (I) ;}; $ numbering. fadeIn (1700) ;}) ;}; script
The above describes how to create a coupon code for PHP/THINKPHP, including related content, and hope to help friends who are interested in PHP tutorials.