10-2
上課範例:blocks/contact_qrcode.php
02 | function contact_qrcode_show( $options ){ |
03 | if (preg_match( "/contact\/index.php\?sn=/i" , $_SERVER [ 'REQUEST_URI' ])){ |
04 | $url = str_replace ( "index.php" , "pda.php" , $_SERVER [ 'REQUEST_URI' ]); |
05 | } elseif (preg_match( "/contact\/$/i" , $_SERVER [ 'REQUEST_URI' ])){ |
06 | $url = $_SERVER [ 'REQUEST_URI' ]. "pda.php" ; |
12 | if ( file_exists (TADTOOLS_PATH. "/qrcode.php" )){ |
13 | include_once TADTOOLS_PATH. "/qrcode.php" ; |
14 | $qrcode = new qrcode(); |
15 | $block = $qrcode ->render( $url ); |