Jump to content

Weird additional code after save


MarketSg

Recommended Posts

i have this ad banner setting in my admin panel, i try to save this adv code

 

<!-- Start of adf.ly banner code -->
<div style="width: 728px; text-align: center; font-family: verdana; font-size: 10px;"><a href="http://adf.ly/?id=6014384"><img border="0" src="https://cdn.adf.ly/images/banners/adfly.728x90.2.gif" width="728" height="90" title="AdF.ly - shorten links and earn money!" /></a><br /><a href="http://adf.ly/?id=6014384">Get paid to share your links!</a></div>
<!-- End of adf.ly banner code -->

 

After saveing it give me this code below

 

<!-- Start of adf.ly banner code -->\r\n<div style=\"width: 728px; text-align: center; font-family: verdana; font-size: 10px;\"><a href=\"http://adf.ly/?id=6014384\"><img border=\"0\" src=\"https://cdn.adf.ly/images/banners/adfly.728x90.2.gif\" width=\"728\" height=\"90\" title=\"AdF.ly - shorten links and earn money!\" /></a><br /><a href=\"http://adf.ly/?id=6014384\">Get paid to share your links!</a></div>\r\n<!-- End of adf.ly banner code -->

 

As you can see there is some additional code been added, the more i press save button the more the additionak code will be added.. below is the code for the page.. pls help..

 

<?php
if (!isset($_SESSION)) session_start();
    if(!isset($_SESSION['admin_vmp']))
    header('Location: ./login.php');
    include "header.php";
    include "../functions.php";
if(isset($_POST['leaderboard1']))
{
    $leaderboard1 = $_POST["leaderboard1"];
    $leaderboard1=mysql_real_escape_string($leaderboard1);
    
    $leaderboard2 = $_POST["leaderboard2"];
    $leaderboard2=mysql_real_escape_string($leaderboard2);
    
    $medrec = $_POST["medrec"];
    $medrec=mysql_real_escape_string($medrec);
    
    update_ads($leaderboard1,$leaderboard2,$medrec);
}
?>
    <title>Ads - <?php echo(get_title()) ?></title>
    <script type='text/javascript'>
    $(window).load(function(){
    $(document).ready(function () {
        $('#selectall').click(function () {
            $('.selectedId').prop('checked', this.checked);
        });

        $('.selectedId').change(function () {
            var check = ($('.selectedId').filter(":checked").length == $('.selectedId').length);
            $('#selectall').prop("checked", check);
        });
    });
    });
    </script>
    <?php
    include "header_under.php";
    ?>      
        <div id="containerHolder">
            <div id="container">
                <div id="sidebar">
                    <ul class="sideNav">
                        <li><a href="./settings.php">Website</a></li>
                        <li><a href="./thumbnails.php">Thumbnails</a></li>
                        <li><a href="./watermark.php">Watermark</a></li>
                        <li><a href="./media.php">Media</a></li>
                        <li><a href="./social.php">Social Media</a></li>
                        <li><a href="./ads.php" class="active">Ad Management</a></li>
                        <li><a href="./admin.php">Admin Settings</a></li>
                        <li><a href="./analytics.php">Analytics (Stats Tracking)</a></li>
                        <li><a href="./rss.php">RSS Settings</a></li>
                        <li><a href="./sitemap.php">Sitemap Settings</a></li>
                        <li><a href="./comments.php">Comments Setting</a></li>
                    </ul>
                    <!-- // .sideNav -->
                </div>    
                <!-- // #sidebar -->
                
                <!-- h2 stays for breadcrumbs -->
                <h2>Ad Management</h2>
                
                <div id="main">
                    <br />
                    <form action="./ads.php" method="post">
                        <fieldset>
                        <p><a name="top_leaderboard"><label><b>Top : Large leaderboard (728 x 90)</b></label></a><textarea name="leaderboard1" style="width:98%" rows="1" cols="1"><?php echo(show_leaderboard1_ad()) ?></textarea></p>
                        <p><a name="bottom_leaderboard"><label><b>Bottom : Large leaderboard (728 x 90)</b></label></a><textarea name="leaderboard2" style="width:98%" rows="1" cols="1"><?php echo(show_leaderboard2_ad()) ?></textarea></p>
                        <p><label><a name="med_rec"><b>Sidebar : Medium Rectangle (300 x 250)</b></label></a><textarea name="medrec" style="width:98%" rows="1" cols="1"><?php echo(show_rectangle_ad()) ?></textarea></p>
                        <input type="submit" class="myButton" value="Update Ads">
                        </fieldset>
                    </form>
                        <?php
                        if(isset($_POST['leaderboard1']))
                        echo('<div class="alert alert-success">Ads Updated Successfully</div>');
                        ?>
                </div>
                <!-- // #main -->
                
                <div class="clear"></div>
            </div>
            <!-- // #container -->
        </div>    
        <!-- // #containerHolder -->
<?php
include "footer.php";
?>

Link to comment
https://forums.phpfreaks.com/topic/286256-weird-additional-code-after-save/
Share on other sites

The google analytics function have the problem too.. after i save the analytics code it show  the additioanl code too..

 

 

analytics.php

 

<?php
if (!isset($_SESSION)) session_start();
if(!isset($_SESSION['admin_vmp']))
    header('Location: ./login.php');
    include "header.php";
    include "../functions.php";
    $error = "";
    
function update_analytics($analytics)
{
    $analytics = mysql_real_escape_string($analytics);
    $update_query = "UPDATE analytics SET tracking_code='".$analytics."'";
    $qry = mysql_query($update_query);
    return true;
}

if(isset($_POST['analytics']))
{
    $analytics = $_POST["analytics"];
    $analytics=mysql_real_escape_string($analytics);
    update_analytics($analytics);
}

?>
<title>Analytics (Stats Tracking) - <?php echo(get_title()) ?></title>
    <script type='text/javascript'>
        $(window).load(function(){
        $(document).ready(function () {
            $('#selectall').click(function () {
                $('.selectedId').prop('checked', this.checked);
            });

            $('.selectedId').change(function () {
                var check = ($('.selectedId').filter(":checked").length == $('.selectedId').length);
                $('#selectall').prop("checked", check);
            });
        });
        });
    </script>
<?php
include "header_under.php";
?>      
        <div id="containerHolder">
            <div id="container">
                <div id="sidebar">
                    <ul class="sideNav">
                        <li><a href="./settings.php">Website</a></li>
                        <li><a href="./thumbnails.php">Thumbnails</a></li>
                        <li><a href="./watermark.php">Watermark</a></li>
                        <li><a href="./media.php">Media</a></li>
                        <li><a href="./social.php">Social Media</a></li>
                        <li><a href="./ads.php">Ad Management</a></li>
                        <li><a href="./admin.php">Admin Settings</a></li>
                        <li><a href="./analytics.php" class="active">Analytics (Stats Tracking)</a></li>
                        <li><a href="./rss.php">RSS Settings</a></li>
                        <li><a href="./sitemap.php">Sitemap Settings</a></li>
                        <li><a href="./comments.php">Comments Setting</a></li>
                    </ul>
                    <!-- // .sideNav -->
                </div>    
                <!-- // #sidebar -->
                
                <!-- h2 stays for breadcrumbs -->
                <h2>Analytics (Stats Tracking)</h2>
                
                <div id="main">
                    <br />
                    <form action="./analytics.php" method="post">
                        <fieldset>
                        <p><a name="analytics_code"><label><b>Analytics Code :</b></label></a>
                        <textarea name="analytics" style="width:98%" rows="1" cols="1"><?php echo(get_analytics_code()) ?></textarea></p>
                        
                        <input type="submit" class="myButton" value="Update Analytics Code">
                        </fieldset>
                    </form>
                        <?php
                        if(isset($_POST['analytics']))
                        echo('<div class="alert alert-success">Analytics Code Updated Successfully</div>');
                        ?>
                </div>
             
                <!-- // #main -->
                
                <div class="clear"></div>
            </div>
            <!-- // #container -->
        </div>    
        <!-- // #containerHolder -->
<?php
include "footer.php";
?>
 

 

 

header.php

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!-- CSS -->
<link href="style/css/transdmin.css" rel="stylesheet" type="text/css" media="screen" />
<!--[if IE 6]><link rel="stylesheet" type="text/css" media="screen" href="style/css/ie6.css" /><![endif]-->
<!--[if IE 7]><link rel="stylesheet" type="text/css" media="screen" href="style/css/ie7.css" /><![endif]-->

<!-- JavaScripts-->
<script type="text/javascript" src="style/js/jquery-1.10.2.min.js"></script>

 

 

 

header_under.php

 

</head>
<body>
    <div id="wrapper">
        
        <!-- You can name the links with lowercase, they will be transformed to uppercase by CSS, we prefered to name them with uppercase to have the same effect with disabled stylesheet -->
        <ul id="mainNav">
            <li><a href="./" class="active">DASHBOARD</a></li> <!-- Use the "active" class for the active menu item  -->
            <?php if(allow_pictures()) { ?>
            <li><a href="./pictures.php">Pictures</a></li>
            <?php } if(allow_videos()) { ?>
            <li><a href="./videos.php">Videos</a></li>
            <?php }    if(allow_gifs()) { ?>
            <li><a href="./animated-gifs.php">Animated Gifs</a></li>
            <?php } ?>
            <li><a href="./pages.php">Pages</a></li>
            <li><a href="./settings.php">Settings</a></li>
            <li class="logout"><a href="./logout.php">LOGOUT</a></li>
        </ul>
        <!-- // #end mainNav -->

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.