Using JavaScript ads in my PHP site

fattony

New Member
Messages
13
Reaction score
0
Points
0
I recently got suspended because I forgot to place ads in my site and the reason is is that my site is entirely php and the code they give me for the ads is in javascipt. My questions are as follows:
1) If i were to do the whole echo thing will that work for the ads?
2) Is this the correct code to echo it?

echo "
<script type="text/javascript" src="http://x10hosting.com/adserve.js?advanced">

echo
"</script>"
;

I dont actualy know javascipt so this is causing me a problem.

Thanks for the help.
 

diabolo

Community Advocate
Community Support
Messages
1,682
Reaction score
32
Points
48
I am pretty sure that will work, but your php echo synthax is incorrect...missed out the end quotations (") and semi-colon (;)
 

fattony

New Member
Messages
13
Reaction score
0
Points
0
echo "<script type="text/javascript" src="x10hosting.com/adserve.js?advanced"> ";
echo "</script>";

Is this how it is supposed to be? I cannot get it to work correctly. My site is badjunk.pcriot.com and the code for the footer (where I want to put it) is below. I also dont know where I should put it. Any help would be greatly appreciated!

<?php
if (stristr(htmlentities($_SERVER['PHP_SELF']), "footer.php")) {
Header("Location: index.php");
die();
}
define('NUKE_FOOTER', true);
function footmsg() {
global $foot1, $foot2, $foot3, $copyright, $total_time, $start_time, $commercial_license, $footmsg;
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$end_time = $mtime;
$total_time = ($end_time - $start_time);
$total_time = _PAGEGENERATION." ".substr($total_time,0,4)." "._SECONDS;
$footmsg = "<span class=\"footmsg\">\n";
if (!empty($foot1)) {
$footmsg .= $foot1."<br>\n";
}
if (!empty($foot2)) {
$footmsg .= $foot2."<br>\n";
}
if (!empty($foot3)) {
$footmsg .= $foot3."<br>\n";
}

if ($commercial_license == 1) {
$footmsg .= $total_time."<br>\n</span>\n";
} else {
$footmsg .= $copyright."<br>$total_time<br>\n</span>\n";
}
echo $footmsg;

}

function foot() {
global $prefix, $user_prefix, $db, $index, $user, $cookie, $storynum, $user, $cookie, $Default_Theme, $foot1, $foot2, $foot3, $foot4, $home, $name, $admin, $commercial_license;
if(defined('HOME_FILE')) {
blocks("Down");
}
if (basename($_SERVER['PHP_SELF']) != "index.php" AND defined('MODULE_FILE') AND file_exists("modules/$name/copyright.php") && $commercial_license != 1) {
$cpname = str_replace("_", " ", $name);
echo "<div align=\"right\"><a href=\"javascript:eek:penwindow()\">$cpname &copy;</a></div>";
}
if (basename($_SERVER['PHP_SELF']) != "index.php" AND defined('MODULE_FILE') AND (file_exists("modules/$name/admin/panel.php") && is_admin($admin))) {
echo "<br>";
OpenTable();
include("modules/$name/admin/panel.php");
CloseTable();
}
themefooter();
if (file_exists("includes/custom_files/custom_footer.php")) {
include_once("includes/custom_files/custom_footer.php");
}
echo "</body>\n</html>";
ob_end_flush();

die();
}

foot();

?>
 

diabolo

Community Advocate
Community Support
Messages
1,682
Reaction score
32
Points
48
includes/custom_files/custom_footer.php

look at that file, if you still need help give me the code for that file..
 

conker87

New Member
Messages
65
Reaction score
0
Points
0
PHP:
echo "<script type=\"text/javascript\" src=\"x10hosting.com/adserve.js?advanced\">";
echo "</script>";
Is how it should look. You need to escape the quotation marks.
 
Top