+ Reply to Thread
Results 1 to 5 of 5

Thread: Using JavaScript ads in my PHP site

  1. #1
    fattony is offline x10Hosting Member fattony is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    13

    Using JavaScript ads in my PHP site

    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.

  2. #2
    diabolo's Avatar
    diabolo is offline Community Advocate diabolo is on a distinguished road
    Join Date
    Nov 2007
    Location
    Jersey Shore
    Posts
    1,683

    Re: Using JavaScript ads in my PHP site

    I am pretty sure that will work, but your php echo synthax is incorrect...missed out the end quotations (") and semi-colon (;)

  3. #3
    fattony is offline x10Hosting Member fattony is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    13

    Re: Using JavaScript ads in my PHP site

    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:openwindow()\">$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();

    ?>

  4. #4
    diabolo's Avatar
    diabolo is offline Community Advocate diabolo is on a distinguished road
    Join Date
    Nov 2007
    Location
    Jersey Shore
    Posts
    1,683

    Re: Using JavaScript ads in my PHP site

    includes/custom_files/custom_footer.php

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

  5. #5
    conker87 is offline x10Hosting Member conker87 is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    UK
    Posts
    65

    Re: Using JavaScript ads in my PHP site

    PHP Code:
    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.

+ Reply to Thread

Similar Threads

  1. XML and Javascript
    By cuteboytm in forum Graphics & Webdesign
    Replies: 1
    Last Post: 09-21-2007, 10:00 AM
  2. Great: My site back, but ... php problem
    By lionheart8 in forum Free Hosting
    Replies: 2
    Last Post: 07-04-2007, 10:20 AM
  3. If You're Having PHP Problems With Your Site
    By TranceOperator in forum Free Hosting
    Replies: 3
    Last Post: 09-02-2005, 12:23 PM
  4. PHP Messing Up?
    By TranceOperator in forum Free Hosting
    Replies: 4
    Last Post: 08-10-2005, 10:09 PM
  5. Links to Many Many Resources!
    By Superpoo in forum Scripts & 3rd Party Apps
    Replies: 18
    Last Post: 03-29-2005, 06:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers