PDA

View Full Version : Autoclean website code, is it possible?


itsanna
01-05-2008, 10:33 AM
I'm trying to make a header and a footer (.php) for my website so I can do the <?PHP
include("footer.php");
?> thing, I started making the website with the sitebuilder in my cpanel, but decided i didn't want to use the sitebuilder after all (it was a d.i.y. template) and started copying the html and stuff to make it myself instead, but it's added tons of extra code that I don't need or want. I'm trying to take the bits I need for the header and footer from my main index page.

I'm getting there, almost done it the way I want, but still having some problems with too much code.

I'm not techie at all, have really no clue about html or css, but I'm great at copy/paste ;) :p

Is there any online editor that will clean up my code for me automatically?

Thanks

Anna

Andan
01-05-2008, 11:22 AM
I don't know of any editor (online or offline) that will remove valid code that you want. For the most part editors have a feature that makes code a bit easier to read, corrects syntax, and makes sure code is valid, but other than that it's usually up to the coder to remove sections that they may not want.

Since it is the internet, I would not be surprised if such an editor did exist.

Do you have a link to the page by chance?

itsanna
01-05-2008, 11:44 AM
Thanks for the reply Andan :)

Well it's 3 pages actually, my main index page that I want to make a header and footer from: http://adorablebudgies.co.uk

I have a test header here: http://adorablebudgies.co.uk/test/header.php
and test footer here: http://adorablebudgies.co.uk/footer.php
(a different colour if you go to footer2.php)

There's a thick bar of colour close to the bottom of the main page that I would also like to include in my footer, but I'm finding it impossible no matter how I do it though :p

Coding is definitely not my strong point ;)

Anna

Andan
01-05-2008, 11:59 AM
Um...hmm. If you want that thick purple bar above the footer, you'd need to know cascading style sheets and basic HTML (tables, etc.). The thick purple bar at the footer is a defined (table cell) layer in the page's stylesheet.

It's not as simple as cutting the bar, the footer, and the header and moving it to another page. The entire page is organized using tables (think a spreadsheet), and different cells of that table have different properties (background color, size and dimensions, etc.).

From a few glances at the source code, I have a rough idea of what to cut out, but the syntax is very unorganized and messy.

You'd need to remove the links (the navigation at the left):
<li><a href="http://adorablebudgies.co.uk/index.php" id="normal" target="_self">Home</a></li>

<li><a href="http://adorablebudgies.co.uk/Budgerigar-Articles.php" id="normal" target="_self">Budgie Articles</a></li>

<li><a href="http://adorablebudgies.co.uk/pictures.php" id="normal" target="_self">Photo Album</a></li>

<li><a href="http://adorablebudgies.co.uk/links.php" id="normal" target="_self">Budgie Links</a></li>

<li><a href="http://adorablebudgies.co.uk/about.php" id="normal" target="_self">About Us</a></li>

<li><a href="http://adorablebudgies.co.uk/birds.php" id="normal" target="_self">Birds For Sale</a></li>

<li><a href="http://adorablebudgies.co.uk/breed.php" id="normal" target="_self">Breeders Near You</a></li>

Also the body of text to the right:
</strong>
<div style="text-align: center;">Welcome to Adorable Budgies</div>
<strong><br />

</strong><br />

<div style="text-align: left;"> * Have you been looking for a place to find out all you need to know about keeping budgerigars?<br />

<img title="box" alt="box" src="images/delite.JPG" align="right" border="0" width="120" /><br />

* Maybe you're looking for a place to find responsible budgie breeders somewhere near you?<br />

<br />

* Are you looking for links to great items to help boost your budgies health, happiness and well-being?<br />

<br />
* Would you you just like to hang out, look at pictures of cute
and adorable budgies and possibly have a bit of a chat with other bird
lovers?<br />

</div>
<strong><br />

<br />

</strong>

<div style="text-align: left;">
<p><img title="bods" alt="bods" src="images/bods1.JPG" align="left" border="0" width="120" />This website will be filled with
articles, pictures, videos and anything else that can help YOU be as
responsible about your birds as you possibly can be. The whole site
will be dedicated to you and your budgies, so stay tuned and watch for
updates.<br />

</p>

<br />
</div>
<strong><br />

</strong>
<div style="text-align: center;"><strong>Welcome Aboard!</strong></div>

I would not remove the table structure yet, since you'd have to look into the stylesheet and cross reference what cells should be or should not be removed.


The easiest way to remove what you don't want is to use Frontpage, Dreamweaver, or ExpressionWeb (Microsoft's replacement for Frontpage)'s visual editor (not the code tab).

itsanna
01-05-2008, 12:13 PM
Dang, that's a lot of stuff I never even knew about LOL

Thanks for that Andan, I'll carry on and see what I can do from your suggestions.

I haven't got any of the programs that you mentioned, so will have to play around by hand.

Thanks again for the time you took to check this out for me. Much appreciated!

Anna

Andan
01-05-2008, 04:32 PM
There are some free HTML editors out there that provide similar functionality as Frontpage or Dreamweaver. You can just do a Google search for some using a search term like: "free html editor" or "wysiwyg html editor".