Adding Javascript Ad Code In PHP File

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
zahidprimex
Forum Newbie
Posts: 9
Joined: Tue Jan 29, 2008 7:44 am

Adding Javascript Ad Code In PHP File

Post by zahidprimex »

Hii
I want to add a Javascript Ad Code In PHP File. How can I do it help plz
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Re: Adding Javascript Ad Code In PHP File

Post by Zoxive »

Code: Select all

<?php
$Ad = '
<script type="text/javascript">
// My Javascript Code
</script>
';
 
echo $Ad;
 
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Re: Adding Javascript Ad Code In PHP File

Post by Ollie Saunders »

Code: Select all

<?php
$foo = 1;
// here is some php
?>
<script type="text/javascript"><![CDATA[
alert('Here is JavaScript')
]]></script>
<?php
// whoops! here's PHP again
zahidprimex
Forum Newbie
Posts: 9
Joined: Tue Jan 29, 2008 7:44 am

Re: Adding Javascript Ad Code In PHP File

Post by zahidprimex »

Dear Zoxive
Thank For your help.Your code works very well.But the position of object written with javascript is on the top of the page. How can i place it on the bottom? How can I allign it in the middle of the page? Help me plz
Post Reply