The Ad-Code needs to be inserted in HTML, not in PHP.
If you know how to use HTML on PHP you can do it that way too, but it's more difficult.
A simple example of how to insert the ad code is:
HTML:
<html>
<head>
<title>Simple HTML</title>
</head>
<body>
<!-- AD CODE -->
<script type="text/javascript" src="http://x10hosting.com/adserve.js?tbml"></script>
<!-- PHP CODE-->
<?php
// Here you can put your PHP code.
?>
</body>
</html>