I'd go with PHP but you can use them both, but Myspace and Facebook also use other languages like ajax.
W3Schools Online Web Tutorials
That is an awesome website to learn if you are just starting out.
W3Schools Online Web Tutorials
That is an awesome website to learn if you are just starting out.