Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 08-11-2008, 04:39 PM Clean up
Super Talker

Posts: 102
Trades: 0
Can you tell me if I have any useless code in either document.

Code:
<?php require("smf/SSI.php"); ?>
<!--
//Copyright(r) 2008 Aaron Roderigues 
//Last update: August 10, 2008, 1:04 A.M
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Language" content="en-gb, English">
<meta name="author" content="Aaron Roderigues: age 15"> 
<title>Zyberscape</title>
<style type="text/css">/*\*/@import url(css/css.css);/**/</style>
<style type="text/css">
a {
    color: #0084FF;
    text-decoration: none;
    font-size: 12px;
}
</style>
</head>

<body>
    <div>
            <img id="title" src="http://www.webmaster-talk.com/images/title.png" alt="">
            <img id="bark" src="http://www.webmaster-talk.com/images/bark.png" alt="">
            <img id="menu2" src="http://www.webmaster-talk.com/images/menu2.png" alt="">
            <img id="links" src="http://www.webmaster-talk.com/images/links.png" alt="">
            <img id="seper" src="http://www.webmaster-talk.com/images/seper.png" alt="">
<? /* needs to be an indapendant file. goto http://zyberscape.com/news/ to add/delete news */ ?>
            <?php include 'ann.php'; ?>
    </div>

<div id="newstitle">
    <img src="http://www.webmaster-talk.com/images/news.png" alt=""><hr>
</div>

<div id="news">
    <div id="wpmd">
        <div>
            <?php ssi_boardNews(); ?>
        </div>
    </div>
</div>

<div id="linkss">
    <div align="center">
        <?php 
            if ($context['user']['is_logged'])
            {
                echo '<!-- Nothing here yet, but the server knows your logged into the forum -->';
            } 
        ?>
        <a class="nav" href="smf/index.php">Forums</a>
        <a class="nav" href="aaron/tools/pwgen.php">Password Gen</a>
        <a class="nav" href="aaron/tools/ss.php">Server Status Page</a>
        <a class="nav" href="aaron/tools/rsgrabber.php">Runescape stats grabber</a>
        <a class="nav" href="http://rsu.zyberscape.com/">RSU</a>
        <a class="nav" href="news/">Add Announcement</a>
    <a href="http://validator.w3.org/check?uri=referer">
        <img src="http://www.w3.org/Icons/valid-html401"
                alt="Valid HTML 4.01 Transitional" />
    </a>
        <a href="http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fzyberscape.com&profile=css3&usermedium=all&warning=1
">
        <img src="http://jigsaw.w3.org/css-validator/images/vcss"
            alt="Valid CSS!" />
    </a>
        <br>
        <a href="http://host-tracker.com/website-monitoring-info/1071228/ff/">
            <img width=80 height=15 border=0 alt='website monitoring service' src="http://ext.host-tracker.com/uptime-img/?s=15&t=1071228&m=0.59&p=Total&src=ff"></a>
    </div>
</div>

<div id="copy">
Gotex Gaming &copy; Copyright, &reg; All Rights Reserved, 2007 - <?php echo '' .date('Y'); ?><br>
<a href="http://myspace.com/ajjr1228">&copy;Copyright 2007 - <?php echo '' .date('Y'); ?> Aaron Roderigues.</a>
</div>

</body>
</html>
Ann.php
Code:
<? /* needs to be an indapendant file. */ ?>

<?php
include("news/include/config.php");
include("news/include/opendb.php");

$query = mysql_query("SELECT * FROM `test` LIMIT 1");
while( $row = mysql_fetch_assoc($query) )
{
/* buggy */
    echo "    <div id=\"announce\">
                <img src=\"http://www.webmaster-talk.com/images/announce.png\" alt=\"\" /><br>
            <div id=\"1\" style=\"border:#FF0000 2px SOLID;\">
                    {$row['news']}
            </div></div>
            <div id=\"shout\">
                <img src=\"http://www.webmaster-talk.com/images/shout.png\" alt=\"\" /><br>
            <div id=\"1\" style=\"border:#3399FF 2px SOLID;\">
                    {$row['shout']}
            </div></div>\n";
}
include("news/include/closedb.php");
?>
Aaron™ is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-11-2008, 05:45 PM Re: Clean up
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
I have a few comments:

1) Since you're under age, don't display your age. Too easy for bad people to track you down and have a lot of info on you.

2) Don't use empty alt="" values in img tags. They serve 3 purposes: 1) If your images are broken, they display something. 2) If a disabled person is visiting your site, that description may be all they know of the image -- even if the description is that it's a useless image. 3) Give search engines a hint about what the image is about.

3) If by copyright(r) you mean that you have registered the copyright, then I doubt that and you're likely violating the law by saying so. I am not providing legal advice, just raising a red flag for you to investigate things on your own.

4)
PHP Code:
echo '    <div id="announce">
            <img src="images/announce.png" alt="" /><br>
        <div id="1" style="border:#FF0000 2px SOLID;">
                '
.$row['news'].'
        </div></div>
        <div id="shout">
            <img src="images/shout.png" alt="" /><br>
        <div id="1" style="border:#3399FF 2px SOLID;">
                '
.$row['shout'].'
        </div></div>
'

Is easier to read, fewer characters, and parsed very-slightly faster.

5) Title attributes for URLs are useful -- they hint to search engines what the site is about and can inform users as well.

6) Meta tags should be used if you want more search engine advantages.

7) No need to close php and then open it 2 lines down (with nothing inbetween). This is likely to cause you more session-based headaches than you want.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 08-11-2008, 06:10 PM Re: Clean up
Super Talker

Posts: 102
Trades: 0
I am a 15 year old, soon to be drop out from MA.

Well the only reason I even have the alts is because W3 doesn't like when you don't them.

I highly doubt that 70% of the web sites in the world have actual copyrights,

anyway thanks for the quick clean up.
Aaron™ is offline
Reply With Quote
View Public Profile
 
Old 08-11-2008, 06:12 PM Re: Clean up
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
alts should be included. 100% of sites are copyrighted. When you create something, at least in the US, it's automatically copyrighted. My thing for you to look at was the suggested that it was a registered copyright -- you can't claim that unless it has been registered.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Reply     « Reply to Clean up
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.70768 seconds with 12 queries