Eric @ EricBess WebHome

Wins do not arrogant, not to lose hungry, there is shock chest and face, such as mine Pinghu

Chinese (Simplified) flagItalian flagKorean flagPortuguese flagEnglish flagGerman flagFrench flagSpanish flagJapanese flagArabic flagRussian flagGreek flagDutch flagBulgarian flagCzech flagCroat flagDanish flagFinnish flagHindi flagPolish flagRumanian flagSwedish flagNorwegian flagCatalan flagFilipino flagHebrew flagIndonesian flagLatvian flagLithuanian flagSerbian flagSlovak flagSlovenian flagUkrainian flagVietnamese flag
By N2H

JavaScript is called SOAP

Would like to have been directly JavaScrip call Xurrency.com of SOAP, the realization of the exchange rate of AJAX, to find a JavaScript SOAP Client done a test. Local on IE, Chrome successful return, firefox with the host on the error, "access to restricted URI DENIED" I do not know why his.

Decided to give up. Using php soapclient + jquery ajax to achieve.

JavaScript SOAP Client test code is as follows:

? Download test.html
 1 
 2 
 3 
  4, 
 5 
  6, 
 7 
  Of 8 
 9 
  Of 10 
 11 
 12 
 13 
 14 
 15 
 16 
 17 
  On 18 
 19 
  20, 
 21 
 22 
 23 
 24 
 25 
 26 
 27 
 28 
 29 
  "-//W3C//DTD XHTML 1.0 Strict//EN" <! DOCTYPE html PUBLIC "- / / W3C / / DTD XHTML 1.0 Strict / / EN"  
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
  "http://www.w3.org/1999/xhtml"  lang = "en"  xml : lang = "en" > <Html xmlns = "http://www.w3.org/1999/xhtml" lang = "en" xml: lang = "en"> 
  <Head> 
  XHTML - document </ title > <Title> XHTML - document </ title> 
  "text/javascript"  src = "soapclient.js" ></ script > <Script type = "text / javascript" src = "soapclient.js"> </ script> 
  "text/javascript" > <Script type = "text / javascript"> 

	  function currency () ( 
		  "http://xurrency.com/servidor_soap.php" ; var url = "http://xurrency.com/servidor_soap.php"; 
		  new  SOAPClientParameters ( ) ; var pl = new SOAPClientParameters (); 
		  "amount" , 5 ) ; pl. add ( "amount", 5); 
		  "base" , "usd" ) ; pl. add ( "base", "usd"); 
		  "target" , "eur" ) ; pl. add ( "target", "eur"); 
		  url , "getValue" ,  pl , true ,  Currency_callBack ) ; SOAPClient. Invoke (url, "getValue", pl, true, Currency_callBack); 
	  ) 

	  r ) { function Currency_callBack (r) ( 
		   r ) ; alert (r); 
		  ) 

  </ Script> 
  </ Head> 
  <Body> 
	  "" > <Form action = ""> 
  button value = "Invoke"  onclick = "currency();" /> <Input type = button value = "Invoke" onclick = "currency ();" /> 
  </ Form> 
  </ Body> 
  </ Html> 

November 10th, 2008 Posted by eric | Coding, Web technology | no comments

ZendDebugger for Freebad

Requester:

disable your ZendOptimizer and eaccelerator
download ZendDebugger.os place to / usr/local/lib/php/20060613 /

ZendDebugger.so for freebsd (2.2 MiB, 5 hits)
You need to be a registered user to download this file.

Install:

edit your php.ini. For me php.ini is in / usr / local / etc /

[Zend]
zend_extension=/usr/local/lib/php/20060613/ZendDebugger.so
zend_debugger.allow_hosts=10.10.2.0/24
zend_debugger.expose_remotely=always
zend_debugger.connector_port=10001

restart your apache

Look in the phpinfo () got the result below!

zenddebugger

Click to continue reading

November 3rd, 2008 Posted by eric | Coding, System, unclassified | no comments

php to prevent malicious applets visit

Originally written PAYPAL IPN response when used repeatedly to try to prevent a function of the protection of the poor, later changed to address the original audit ($ hostname = gethostbyaddr ($ _SERVER [ 'REMOTE_ADDR']); if (! Preg_match ( '/ paypal \. com $ / ', $ hostname)) {.....), it abandoned on the 000. In the record before the cut did not come, there should be a better algorithm, the study who do not know.

? View Code PHP
 1 
 2 
 3 
  4, 
 5 
  6, 
 7 
  Of 8 
 9 
  Of 10 
 11 
 12 
 13 
 14 
 15 
 16 
 17 
  On 18 
 19 
  ! avoid_refresh ( '15' ) ) die ( "Hacking Attempt!!" ) ; if (! avoid_refresh ('15 ')) die ( "Hacking Attempt!!"); 
  ..... 
  ..... 
  ..... 
  $time ) { function avoid_refresh ($ time) ( 
	  ; session_start (); 
    isset ( $_SESSION [ "post_sep" ] ) ) { if (isset ($ _SESSION [ "post_sep"])) ( 
        time ( ) - $_SESSION [ "post_sep" ] < $time ) { if (time () - $ _SESSION [ "post_sep"] <$ time) ( 
      	  "post_sep" ] = time ( ) ; $ _SESSION [ "Post_sep"] = time (); 
          ; return false; 
        { ) Else ( 
            "post_sep" ] = time ( ) ; $ _SESSION [ "Post_sep"] = time (); 
            ; return true; 
        ) 
    { ) Else ( 
        "post_sep" ] = time ( ) ; $ _SESSION [ "Post_sep"] = time (); 
        ; return true; 
    ) 
  ) 

October 30th, 2008 Posted by eric | Coding | no comments

PHP Data Encryption

Data encryption in our life has become increasingly important, especially in light of the network took place on a large number of transactions and transfer of large amounts of data. If you are interested in the adoption of safety measures, are also bound to be interested in learning PHP to provide a range of security features. In this article, we will introduce these features to provide some basic usage, so that you can own application software to add security features.

Prior knowledge

PHP in the details of the security function, we need to spend a bit of time has not come into contact with the contents of this area's readers some basic knowledge of cryptography, if the basic concepts of cryptography is already very familiar with, you can skip this part of the past .

Cryptography can be described as popular on the encryption / decryption of research and experiments, the encryption is easy to understand information is not easily converted to process information, not easily moving to decrypt the data is converted to the original easy-to-understand information. Do not understand the information referred to as passwords, easy-to-understand information, known as code.

The data encryption / decryption requires a certain algorithms can be very simple, such as the famous Caesar code, but the current encryption algorithm to be relatively much more complex, some of which make use of existing methods can not even decipher the.

PHP encryption function as long as there is one thing to use non-Windows platforms may experience crypt () is also quite familiar with the completion of this function is called a one-way encryption function, it can be a number of encryption codes, passwords can not be converted to the original The codes. Despite the face of it this seems to be a useless function, but it is widely used to guarantee the integrity of the system password. This is because once the one-way encrypted passwords fall into the hands of a third party who, as can not be reduced to express and therefore not much use. In the validation of user input a password, the user input is also used in a one-way algorithm, if the importation and storage of encrypted password after the match, then entered a message must be correct.

crypt () function

PHP also offers the use of its crypt () function to complete a one-way encryption. I will be here a brief introduction to the function:

string crypt (string input_string [, string salt])

Input_string the parameters need to be encrypted string, the second optional salt is a bit string, it can affect the encryption code, known as rule out further attacks are expected to count. By default, PHP using a 2-character string interfere with DES, if you are using the system MD5 (I will be introduced later in the MD5 algorithm), it will use a 12-character string of interference. By the way, can be found in order to implement the following system will be used to interfere with the length of the string:

print "My system salt size is:". CRYPT_SALT_LENGTH;

System may also support other encryption algorithm. crypt () to support four algorithm, which is supported by the following algorithm and the corresponding parameters of the length of salt:

Salt length of the algorithm
CRYPT_STD_DES 2-character (Default)
CRYPT_EXT_DES 9-character
CRYPT_MD5 12-character beginning with $
CRYPT_BLOWFISH 16-character beginning with $

1 2 3

October 30th, 2008 Posted by eric | Coding, unclassified | no comments

WordPress plug-ins \ theme of the localization

Once you plug the programming work is over, another aspect that is how you plug the internationalization (of course, which is built on your work you want to release to the public on the premise). "Internationalization" of a building that is your software so that it can be localized in the process; "localization" of software that will show you the text translated into various languages. WordPress has been all over the world come from the local fans, it will be to internationalization and localization features into its structure, including the localization of the plug-in function. Would like to learn more about the localization of the GNU gettext background knowledge, in the light of translation WordPress.

Strongly recommend that you carry out your plug-in internationalization, so that the user name from all corners of the country can localize it. This whole process is very straightforward:

  • Give your plug-in election with a translation of the "text of the domain" name. This is generally the same plug-in your paper the same name, of course, does not include. Php suffix, and must be unique, at least not with the guarantee that the user has to install other plug-in of the same name.
  • At any time you want to use the plug-in to the web page to display text readers (that is, "text message") as much as possible to embed them in the following two procedures WordPress gettext function in any of the above. Keep in mind that different from the core WordPress code, plug-in you, the internationalization of the function, you should use the second parameter to pass you on-demand version of the domain. The core code in WordPress, the default parameter is empty.

__ () Message will be used as a parameter passed to another function. _e () used to write message directly to the page.

__ ($ message, $ domain): Using the language of the localization of $ domain for the translation of $ message. The output string can continue to be other function call.
_e ($ message, $ domain): Using the language of the localization of $ domain for the translation of $ message, and then to show the user's screen. If your text will be displayed directly to the reader, you can use this function.
  • For your plug-in to create a document POT (a list of all the text of the translation entry), together with the plug-in your launch. Plug-in users will need to generate a good translation localization MO, and then put it in your plug-in in the same folder. Mo and the name of the file also pay attention to, as should be the domain-ll_CC.mo, here is ll_CC local and national language code (for example, zh_CN). Reference to the translation of WordPress more on the POT file, MO localization of documents and information.
  • In the plug-in you added load_plugin_textdomain a subroutine to call your plug-in translation. The sub-gettext you need a certain function ahead, but the best is the later the better (because of a number of multi-lingual plug-in called in when a number of changes in the geographical settings). Perhaps the way forward is for all your plug-in's initial subroutines in front of the addition of a subroutine. For example, if your domain is called the text "fabfunc", are:

Click to continue reading

October 27th, 2008 Posted by eric | WordPress, Wordpress Programming, Web technology | no comments

To. JS transmission parameters

js:

? View Code JAVASCRIPT
 1 
 2 
 3 
  4, 
 5 
  6, 
 7 
  Of 8 
 9 
  Of 10 
 11 
 12 
 13 
  500 ; //time in millis to wait before showing dialog var BT_open_wait = 500; / / time in millis to wait before showing dialog 
   0; //time in millis to wait before closing dialog var BT_close_wait = 0; / / time in millis to wait before closing dialog 
  true ; var BT_cache_enabled = true; 

  hash ) function BT_setOptions (hash) 
  ( 
	  hash [ "openWait" ] != null ) if (hash [ "openWait"]! = null) 
		  "openWait" ] ; BT_open_wait = hash [ "openWait"]; 
	  hash [ "closeWait" ] != null ) if (hash [ "closeWait"]! = null) 
		  "closeWait" ] ; BT_close_wait = hash [ "closeWait"]; 
	  hash [ "cacheEnabled" ] != null ) if (hash [ "cacheEnabled"]! = null) 
		  "cacheEnabled" ] ; BT_cache_enabled = hash [ "cacheEnabled"]; 
  ) 

HTML value:

? View Code HTML
 1 
 2 
 3 
  4, 
 5 
  6, 
  <script type="text/javascript" src="path-to/XXX.js"> </ script>  
  <script type="text/javascript"> 
      $ (function () ( 
         BT_setOptions ((openWait: 2000, closeWait: 4000, enableCache: false)); 
      )) 
  </ script> 

September 13th, 2008 Posted by eric | Coding | no comments

2 3 4 5 6 7 » Page 1 of 7 1 2 3 4 5 6 7 »