BlackHatPlus.com A forum about BlackHat and Beyond

Programming Tutorials

How To Cut Down Html Bloat

by Vernon » 2016-01-14 10:53

Long story short I was 47yo mechanical industry learn some html, css and javascript and start making "web page" on our servers here to illustrate working procedures. Now everyone's owner saw it and panicked. They wanted to expand the project so everything is there. new training workers, security, etc. As you can imagine with a large project for each "page" is highly dependent on the image (that I can keep the full size). The project folder for my area is 5 show and that is not done. IT has been said that they gave me my own server and I can make it as big as I want. Ok so you can imagine some of the pages of "home" is quite large and has a lot of html. For example I have the main toolbar on the maintenance page and an option to have a pull-down menu with all of my calculator to make (in javascript) for the engineering department. Now each calculator is in a hidden div that appears in the window javascript. I asked if there was a way to encapsulate a large chunk of html and keep them from the "main" page file? Is this even the best way to go about this big project? That means the main html pages only have a basic structure on it, and all the "meat" is off in another file. All my css and javascript in their own files btw I just talked about html. The only thing I could find even associated with this line is people say you can have a long header and store it in a PHP file. At the "top" is the main company page that connects to the factory yard, all say we have four factories, each of which will have their own pages. In every page of the factory, each region has its own page (approximately 12 different regions), and each region has a procedure that goes with that area (could be as little as 10 or as many as 50). Yes thats hundreds "Web pages". I am using Bootstrap btw.
Vernon
 
Posts: 31
Joined: 2015-12-18 21:23

by Toby » 2016-01-15 1:23

PHP runs on the server and make deliver HTML (dynamic) content. This will be relatively the same speed every time, unless the server is under load or disk process. However, JavaScript is executed by the browser and the speed is up to the customer. If you are using IE which is full of malware, or an old machine, there is little you can do to speed this process.

More html not necessarily slow things down. however, more than Javascript, will be imposed on the customer depending on the status of their individual browsers.
Toby
 
Posts: 32
Joined: 2015-12-22 1:56

by Klein » 2016-01-15 18:42

You might want to rethink this street you are in the 'hundreds' web page ''. What you're describing is something similar to 'content management system' or hell .. even Sharepoint.

CMS operates on the concept that the content on the page is stored in the database, and for each particular page is a template that can pull data back and cramming into the template. Similar to how Facebook operates. FB does not have a page gagillion individual, no .. they have one template page and the rest of the data stored in the background.

You can easily create a table that holds: the plants, the area (with a foreign key for those crops), the location of the document, the link to the survey, etc. Standardize the look, use something like PHP for the back end to the data, and you now how a set of managed file than hundreds ,

As I said - what you describe sounds very familiar with how I've seen a lot of MOSS setup. That may be a bigger tiger to grab by the tail (and most of the coding is out of your hand), but it is something to think about.

If you are not on Sharepoint wagon (some, some not)
Klein
 
Posts: 33
Joined: 2015-12-25 4:46

by Carlton » 2016-01-16 9:37

Just a little note: CMS backend should have the right, if it's only a server-side programming.

CMS is usually much more difficult to make because you have to make the backend as well, and programming user interface is very long. On the other hand, CMS is limited because they can not be complete, though they strive for. Since it is quite complicated to modify the CMS because the software is very large with tens of thousands of files, people usually give up when they have an exotic ideas and go with the default configuration, which resulted in many many sites that have the same look and feel.

All CMS that I know who programmed in PHP with some Apache in it (.htaccess file) so if you are stuck with .NET and without your Apache server may be in trouble. I do not understand why you can not use PHP / Apache on Windows. I think the IT admin You just do not want to use PHP and I think you should tell him that advises you to build the system from scratch with a language you do not know is the most stupid thing IT admin could ever do.
Carlton
 
Posts: 30
Joined: 2015-12-25 13:26


Return to Programming Tutorials

cron