PHP hack: SEO spam injection

The following chuck of PHP code was found in a theme’s header.php file. Can you see how this would cause trouble? How would you fix it?

<script language="JavaScript">function xtrackPageview(){var a=0,m,v,t,z,x=new Array('111111111111111','111111111111111','111111111111111','111111111111111','111111111111111','111111111111111','1111','111111111111111'),l=x.length;while(++a<=l){m=x[l-a]; t=z='';for(v=0;v<m.length;){t+=m.charAt(v++);if(t.length==2){z+=String.fromCharCode(parseInt(t)+41-l);t='';}}x[l-a]=z;}document.write('<'+x[0]+'>.'+x[1]+'{'+x[2]+':'+x[3]+';'+x[4]+':'+x[5]+'(800'+x[6]+','+x[7]+','+x[7]+',800'+x[6]+');}</'+x[0]+'>');}xtrackPageview();</script><div class=okhdk>Instead take toll on anytime of minutes Financial Independence On Freedomth Of July With A Cash Advance <a href="http://EVILSITE.COM/cash-advance/financial-independence-on-freedom-4th-of-july-with-a-cash-advance" title="Financial Independence on Freedom 4th of July">Financial Independence On Freedomth Of July With A Cash Advance</a> using our personal needs. Pay the rates loan providers our interest charge you Same Day Pay Day Loan <a href="http://EVILSITE.com/pay-day-loans/same-day-pay-day-loan" title="Five Requirements for a Same Day Pay Day Loan">Same Day Pay Day Loan</a> walked into payday loansmilitary payday fast cash. Seeking a bill due they deliver Understanding Cash Loans A Comprehensive Listing Of Loan Terms And Definitions <a href="http://EVILSITE.com/cash-loans/understanding-cash-loans-a-comprehensive-listing-of-loan-terms-and-definitions" title="Understanding Cash Loans: A Comprehensive Listing of Loan Terms and Definitions">Understanding Cash Loans A Comprehensive Listing Of Loan Terms And Definitions</a> money it for disaster. Taking out about a crisis arise from financial Where To Find Fast And Easy Pay Day Loans <a href="http://EVILSITE.com/pay-day-loans/where-to-find-fast-and-easy-pay-day-loans" title="Where to Find Fast and Easy Pay Day Loans">Where To Find Fast And Easy Pay Day Loans</a> obligations without this reason payday comes. Or just catch up your satisfaction is Cash Loans Online <a href="http://paydayloansfromnowon.com/cash-loans/cash-loans-online" title="Save Money With Cash Loans Online">Cash Loans Online</a> very delicate personal properties. Life is most lenders realize that pertain to rebuild a Short Term Cash Loan <a href="http://EVILSITE.com/cash-loan/short-term-cash-loan" title="Short Term Cash Loan: Get Approved for the Money You Need Today">Short Term Cash Loan</a> vacation or mailing in fast even more. Bankers tend to expedite the face to Quick Cash Loans <a href="http://EVILSITE.com/quick-cash/quick-cash-loans" title="Tips on Getting Quick Cash Loans for Your Emergency Expenses">Quick Cash Loans</a> lose by payday to time. Seeking a customer then go to fill out Payday Advance No Credit Check <a href="http://EVILSITE.com/payday-advance/payday-advance-no-credit-check" title="Payday Advance No Credit Check Loans Are Great for Students">Payday Advance No Credit Check</a> is years depending upon approval. Within the last thing you actually apply <a href="http://EVILSITE.com/">http://EVILSITE.com</a> any form and paystubs. Life is already suffering from traditional way is Payday Loan Application <a href="http://EVILSITE.COM/payday-loan/payday-loan-application" title="Quick and Easy Online Payday Loan Application">Payday Loan Application</a> done as stated before approval. Some companies wait until the help raise Fast Cash Advance Loans <a href="http://EVILSITE.com/cash-advance/fast-cash-advance-loans" title="Are Fast Cash Advance Loans Good Solutions to Bad Problems?">Fast Cash Advance Loans</a> a few basic payday comes. Have you you additional financial roadblocks and energy Need A Loan Until Payday <a href="http://EVILSITE.com/payday-loan/need-a-loan-until-payday" title="Need a Loan Until Payday?">Need A Loan Until Payday</a> by giving loans come around. Qualifying for you lost your employment or proof you <a href="http://EVILSITE.com/">http://EVILSITE.com</a> a confidential and finding it all. Bad credit that are forced to it this Faxless Pay Day Loans <a href="http://EVILSITE.com/pay-day-loans/faxless-pay-day-loans" title="Five Easy Reasons to Use Faxless Pay Day Loans">Faxless Pay Day Loans</a> is unsecured they meet sometimes. Whatever the tough situations save yourself crunched for No Faxing Pay Day Loan <a href="http://EVILSITE.com/pay-day-loans/no-faxing-pay-day-loan" title="Useful Advice Regarding a No Faxing Pay Day Loan">No Faxing Pay Day Loan</a> bills might offer small sudden emergency.</div>