Eric @ EricBess WebHome

Thinking blindly without action, it will be unknowingly become meaningless

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

PHP to prevent errors

To prevent the error message appears in your browser, you can add the corresponding statement in front of @ symbol, such as the following statement to connect the database in the database connection is not the browser fails to display an error message:
$ db = @ mysql_connect (...);

November 17th, 2008 Posted by eric | Coding | no comments

Add to your blog features multi-currency donations (including RMB)

To make their own blog for sustainable development, it is necessary to make it able to feed themselves.

Some time ago, so a donor wordpress plugin WP-DONATORS, can support PAYPAL donation and multi-currency automatic exchange rates. And other donors of different buttons, it also has a background with PAYPAL API real-time communication, the return of payments data, and then the donor specified advertisements and connectivity on the "donor cloud" in the display.

Followed by support for more background and currency. First, the renminbi, paypal.com does not support the yuan, of course, thinking of the "Home", but with the "Home" to communicate their staff not to provide personal donation feature.

Accidentally discovered "PayPal" (that is paypal China) recently in October, the updated cost of the RMB policy, free of charge. Attention should be paid to "PayPal" is specifically for the Chinese yuan paypal business, can not be generic paypal.com account (foreign currency), so you have to specifically for the "PayPal" registered account. Registered "PayPal"

PayPal Sign up now and start accepting credit card payments.

Just that they are using a paypal API with a very easy way to add functionality yuan. When used, as long as in the background add "PayPal" account on the opening of RMB. When people used to donate RMB payment, the amount went to "PayPal" account, go to paypal account other currencies. Can use your credit card to open a foreign currency account paypal.com to support multi-currency
Sign up for PayPal and start accepting credit card payments instantly.

Click to continue reading

November 12th, 2008 Posted by eric | WordPress, Web technology | one comment

JavaScript call SOAP

JavaScrip always wanted to call directly Xurrency.com the SOAP, the realization of the exchange rate of AJAX, to find a JavaScript SOAP Client tested. This machine IE, Chrome successful return, firefox and in the host on the error, "access to restricted URI DENIED" I do not know its所以然.

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

JavaScript SOAP Client test code is as follows:

 1 
 2 
 3 
 4 
 5 
 6 
 7 
 8 
 9 
 10 
 11 
 12 
 13 
 14 
 15 
 16 
 17 
 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

PayPal multi-currency support and the use of IPN

Paypal to receive the following support currency

Code Currency
AUD Australian Dollar
CAD Canadian Dollar
CHF Swiss Franc
CZK Czech Koruna
DKK Danish Krone
EUR Euro
GBP Pound Sterling
HKD Hong Kong Dollar
HUF Hungarian Forint
JPY Japanese Yen
NOK Norwegian Krone
NZD New Zealand Dollar
PLN Polish Zloty
SEK Swedish Krona
SGD Singapore Dollar
USD US Dollar

The use of multi-currency IPN

payment_gross and payment_fee: For non-payment in U.S. dollars, these values are vacant, so IPN script will not deal with these amounts as a dollar.

Multi-currency variables: For non-US dollar payment, IPN will add the following multi-currency variables, mc_gross and mc_fee
mc_gross: transaction fees deducted before the payment is received to pay the full amount of the currency.
mc_fee: with the payment related to currency transaction costs paid. Similar variables payment_fee variable function (amount to be paid in such circumstances, the variable does not display).
For rental IPN, such as registration, revocation, modification, and the failure of EOT, mc_currency is rentcharge currency, rather than the currency of payment.

Click to continue reading

November 7th, 2008 Posted by eric | Web technology, financial and investment | no comments

Zend Studio debug Tips

How to Set $ _GET and $ _POST vars in the debugger

  1. Click on the 'variables' tab of your debug window. You will notice a lot of global, server, and environment vairables. Among them, you should see the empty $ _GET and $ _POST arrays.
  2. Right-click on either array and choose 'assign value.' To input an array, type it in this format: array (value1 => foo, value2 => bar, name => 'James Cricket')

November 4th, 2008 Posted by eric | Coding | 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 | no comments

php prevent malicious applets visit

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

 1 
 2 
 3 
 4 
 5 
 6 
 7 
 8 
 9 
 10 
 11 
 12 
 13 
 14 
 15 
 16 
 17 
 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 the status of our lives has become increasingly important, especially taking into account the network took place in a large number of transactions and transfer of large amounts of data. If the use of safety measures are interested, also will be interested to learn 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 for their own application software to add security features.

Prior knowledge

PHP in detail the security features, we need to spend a bit of time to not come into contact with this aspect of the 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, encryption is easy to understand information will not be converted into easy-to-understand information on the process of moving to decrypt the information is not easy to understand easy-to-understand information is converted to the original process. Do not understand the information is known as password, easy-to-understand information, known as codes.

Data encryption / decryption will require a certain degree of algorithms can be very simple, such as the famous Caesar code, but the current encryption algorithm should be relatively much more complex, some of which make use of the existing methods can not even decipher the.

PHP encryption as long as there is little experience in the use of non-Windows platform may be on the crypt () is quite familiar with the completion of this function is called a one-way encryption function, it can encrypt a number of codes, but can not be converted to the original password the codes. Although the face of it this seems to be a useless function, but it really has been widely used to ensure the integrity of the system password. Because one-way encrypted password once people fall into the hands of third parties, as can not be reduced to express, and therefore does not have any great usefulness. Validate user input in the password, the user input is also used in a one-way algorithm, if the input and stored by the encrypted passwords match, then enter a message must be correct.

crypt () function

PHP also offers the use of its crypt () function to complete the possibility of a one-way encryption. Here I will briefly introduce the function:

string crypt (string input_string [, string salt])

Input_string parameters which need to encrypt the string, the second optional salt is a bit string, it can influence the encrypted code, and further to rule out is called the possibility of attacks is expected to count. By default, PHP uses a two-character string DES interference, if your system using MD5 (I will be introduced at a later MD5 algorithm), it will use a 12-character string interference. By the way, you can order through the implementation of the following system will be found to interfere with the use of the length of string:

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

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

Salt length 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 | no comments

3 4 5 6 7 8 9 10 » ... Last » Page 2 of 23 «1 2 3 4 5 6 7 8 9 10» ... Last »