Actually, pikes were used for both anti infantry and anti cavalry work at different times in history:Pikes were never meant to take a cavalry charge it was origionally fought troop against troop in the phalanx
Seriously guys, the internet is a valuable resource, if you're going to make a sweeping statement like pikes wern't used against cavalry, at LEAST check wikipedia first. Its a click away...Although very long spears had been used since the dawn of organized warfare, the earliest recorded use of a pike-like weapon in the tactical method described above involved the Macedonian sarissa, used by the troops of Alexander the Great's father, Philip II of Macedon, and successive Hellenistic dynasties, which dominated warfare for several centuries in many countries. The formidable wall of spearpoints gave pause even to the legionaries of Rome, but after several fierce contests the legionary style of warfare overthrew the Macedonian phalanx, and the pike faded from use in European warfare until its reintroduction in the late Roman and especially Byzantine army.
In the Middle Ages, the first use of the pike was by urban militia troops such as the Flemings or the peasant array of the lowland Scots, formed in large masses to defeat the cavalry superiority of their royal foes. For example, the Scots used a spear formation called a schiltron in mostly defensive fashion to defeat English knights at the Battle of Bannockburn in 1314, and the Flemings used their geldon long spear to absorb the attack of French knights at the Battle of the Golden Spurs in 1302, before other troops in the Flemish formation counterattacked the stalled knights with plancons. Both battles were seen by contemporaries as stunning victories of commoners over superbly equipped, mounted, military professionals, where victory was owed to the usage of the pike and bravery.
These largely defensive formations were essentially immune to knightly attack as long as the knights obligingly threw themselves on the spear wall, but the passive nature of pike formations when used by such troops with little armour and rudimentary training made them very vulnerable to enemy archers and crossbowmen, who could shoot them down with impunity. Many defeats, such as at Roosebeke and Halidon Hill, were suffered by the militia pike armies when faced by cunning foes who employed their archers and crossbowmen to thin the ranks of the pike blocks before charging in with the knights.