Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6111653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:39:19+00:00 2026-05-23T14:39:19+00:00

Am using php to develop an app and i created a simple template system

  • 0

Am using php to develop an app and i created a simple template system for headers and footers.
My dilemma is that i have many views that depend on the jQuery code, and they all user the header template. Here an excerpt from the header.

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>NgInformr | Adminstration | <?php if(isset($title)) { echo $title; }?></title>
<?=$html->js("javascripts/top_up")?>
<?=$html->css("admin-css")?>
<?=$html->css("form-style")?>
<link href="http://localhost/nginformr/www_root/js/uploadify/uploadify.css" type="text/css" rel="stylesheet"/>
<?=$html->css("base/jquery.ui.all")?>
<?=$html->js("uploadify/jquery.uploadify.v2.1.4.min")?>
<?=$html->js("uploadify/swfobject")?>
<?=$html->js("jquery-ui-1.8.9")?>
<?=$html->js("jscripts/tiny_mce/jquery.tinymce")?>
<script type="text/javascript">
$(document).ready(function() {
//Uploader
$('#file_upload').uploadify({
    uploader : "/nginformr/www_root/js/uploadify/uploadify.swf",
    script  : "/nginformr/www_root/js/uploadify/uploadify.php",
    folder : "/nginformr/www_root/uploads",
    auto : true,
    onComplete : function(event, queueID, fileObj, reponse, data) {
        $('#file_details').css({display:"block"});
        $('#path').val(fileObj.filePath);
        $('#type').val(fileObj.type);
    },
    onError    : function (event,ID,fileObj,errorObj) {
      alert(errorObj.type + ' Error: ' + errorObj.info);
    }
});
$("#side_menu").accordion({header:"p",fillSpace: false});
//Ajax for select boxes
$('#state').change(function() {
        $('#city').html("");
        var id = $('#state').val();
        var dataString = "id="+id;
    $.ajax({
        url:"http://localhost/nginformr/cities/ajax_cities",
        type:"POST",
        data:dataString,
        success:function(html) {
            $('#city').append(html);
        }
    });
});
$("#city").change(function() {
    $('#area').html("");
    var id = $('#city').val();
    var dataString = "id="+id;
    $.ajax({
        url:"http://localhost/nginformr/areas/ajax_areas",
        type:"post",
        data:dataString,
        success:function(html) {
            $('#area').append(html);
        }
    });
});
$('#sector').change(function() {
    $('#category').html("");
    var id = $('#sector').val();
    var dataString = "id="+id;
    $.ajax({
        url:"http://localhost/nginformr/categories/ajax_categories",
        type:"post",
        data:dataString,
        success:function(html) {
            $('#category').append(html);
        }
    });
});
$(".widget").draggable();

//TinyMCE Editor
$('textarea.tinymce').tinymce({
    // Location of TinyMCE script
    script_url : 'http://localhost/nginformr/www_root/js/jscripts/tiny_mce/tiny_mce.js',

    // General options
    theme : "advanced",
    plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist",

    // Theme options
    theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
    theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
    theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
    theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_statusbar_location : "bottom",
    theme_advanced_resizing : true,

    // Example content CSS (should be your site CSS)
    //content_css : "css/content.css",

    // Drop lists for link/image/media/template dialogs
    template_external_list_url : "lists/template_list.js",
    external_link_list_url : "lists/link_list.js",
    external_image_list_url : "lists/image_list.js",
    media_external_list_url : "lists/media_list.js",

    // Replace values for the template plugin
    template_replace_values : {
        username : "Some User",
        staffid : "991234"
    }
});
});
</script>
<script type="text/javascript">
  TopUp.host = "http://localhost/nginformr/";
  TopUp.images_path = "www_root/img/top_up/";
</script>
</head>
<body>
<div id="header"><!-- ------Header -->
<div id="logo">
<a href="./"><?$html->img("nginformr_logo.png") ?></a>
</div>

<div id="user_controls">
<?=$html->link("admin/users/logout","Logout")?>
</div>
</div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:39:19+00:00Added an answer on May 23, 2026 at 2:39 pm

    If you mean to move your jQuery code out of your header and into a separate file, you would simply copy and paste it all (minus the HTML script tags) into a javascript document in your site’s folder (eg general.js).

    Then simply reference that file from the HTML in the same manner you referenced the other javascript files.

    <?=$html->js("general.js")?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets assume I have created a facebook app.So all those who(Admin) have facebook fan
I'm using NetBeans 6.9.1 with the latest PHP plugins, but I'm learning to develop
i am trying to develop an app which can allow me to share data
i have a database in MySQL who i query from a php script. Now
We are about to develop a mini-ERP web-app. We need the app to be
I've to develop a small website which is multi-lingual. This website is using an
I am a web developer and thus I code in xhtml, css, php, sql
A friend recently introduced me to jquery and now I'd like to use it
I am having trouble getting jQuery ajax to recognise a session. I am creating

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.