TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
Advertisement
Associates
Associates
techtuts Darkmindz
CSS Tutorials Tutorialsphere.com - Free Online Tutorials
Boston PHP SurfnLearn
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 10-12-2007, 07:10 AM   #1 (permalink)
The Acquainted
 
obolus's Avatar
 
Join Date: Oct 2007
Location: florida
Posts: 110
Thanks: 36
obolus is on a distinguished road
Default Recently rebuilt site

I just finished rebuilding this site: http://www.tribalstylemusic.net

It's for a close friend of mine's band, based here in Florida. It's definitely not my best design work, but I still like it enough that I didn't bother changing any of the overall design/layout when I rebuilt it.

Before the rebuild:
-Using PHP4
-Had a phpBB2 forum
-Lots of content for the site was pulled from forum posts
-None of the pages were w3c xhtml valid
-Reeeeeally messing html and php coding
-Site used multiple iframes
-Wasn't too friendly with IE
-Each page was a static page (page.php or page.html)

After the rebuild:
-Upgraded to PHP5
-Site now utilizes Smarty template engine
-Ditched the forum
-Looks great in FF, IE and Safari. Haven't seen it in Opera yet.
-Ditched most of the original design structure and simplified/cleaned it up
-Wrote my own news script and system for "index.php?page" url's
-Installed the supercool ImageVuex Flash gallery
-Built an admin section for band members to add/edit/delete content from their browsers
-All pages except 2 are w3c xhtml valid (other 2 will be fixed soon)

Still to do:
-Fix validation issues on 2 pages
-Add more security into coding
-Finish writing a small & simple but secure online store to sell CDs and shirts
-Prob 1 or 2 things I'm forgetting.

I still have a lot to learn with regards to PHP, but I like using little side-projects like this as a way to put what I'm learning to use and practice my coding. Was my first time using the Smarty engine and I really didn't use it to its full potential. I still thought it was pretty cool though. =) Before I started going full-on with the rebuild, and this is something I do before I begin construction on every site I work on, I recoded the overall layout in a single html file on my computer. Basically, I do this as a final design stage before constructing, after I finish drawing out the site design in PS.

Feedback appreciated. =)
obolus is offline  
Reply With Quote
Old 10-12-2007, 01:25 PM   #2 (permalink)
The Reckoner
Advanced Programmer Top Contributor 
 
Karl's Avatar
 
Join Date: Sep 2007
Posts: 438
Thanks: 22
Karl is on a distinguished road
Default

It looks good, nice work. You may want to add an error page for handling errors such as 404:

http://www.tribalstylemusic.net/login.php

Admitidly I shouldn't be so nosy, but you should have something in place just in case someone follows an incorrect URL, always better to gracefully show an error page rather than the typical "404 Not Found".
__________________
Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
Karl is offline  
Reply With Quote
Old 10-12-2007, 10:03 PM   #3 (permalink)
The Acquainted
 
obolus's Avatar
 
Join Date: Oct 2007
Location: florida
Posts: 110
Thanks: 36
obolus is on a distinguished road
Default

heh, true. Thanks for the feedback!

I put up simple but nice custom error pages for 401, 403, 404, 500, and 503 errors.

One thing I need to do is find a way to redirect the user in a similar situation. Right now, the url system uses a bunch of elseif statements to determine what page to display to the user. If I put in a bad query (ie page.php?wrong instead of page.php?right) in my browser, I just get a blank page.

The elseif statements look like so (dont mind the messy code)...

PHP Code:
<?php
if(!$_SERVER['QUERY_STRING']) { ?> 

<?php
// blank query displays default page (index.php)
?>

<? elseif ($_SERVER['QUERY_STRING'] == "page"?>

<?php
// display page with index.php?page as url
?>
So, and especially in the future when I might be working with session id's for users (appended to the end of url's), how do I code it to look for bad queries? Thanks all.
obolus is offline  
Reply With Quote
Old 10-19-2007, 08:26 PM   #4 (permalink)
The Acquainted
 
Join Date: Sep 2007
Location: Arizona
Posts: 114
Thanks: 10
Andrew is on a distinguished road
Default

Also, looks perfect in Opera if you still haven't seen it in that browser. I just compared it to FF and didn't see a difference.
Send a message via AIM to Andrew Send a message via MSN to Andrew
Andrew is offline  
Reply With Quote
Old 10-19-2007, 10:19 PM   #5 (permalink)
The Gregarious
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 532
Thanks: 26
sketchMedia is on a distinguished road
Default

good work m8, looks good.

yea i think opera is highly under-rated by many people.
__________________
sketchMedia is offline  
Reply With Quote
Old 10-30-2007, 12:32 AM   #6 (permalink)
The Wanderer
 
hostfreak's Avatar
 
Join Date: Oct 2007
Posts: 21
Thanks: 1
hostfreak is on a distinguished road
Default

Quote:
Originally Posted by obolus View Post
heh, true. Thanks for the feedback!

I put up simple but nice custom error pages for 401, 403, 404, 500, and 503 errors.

One thing I need to do is find a way to redirect the user in a similar situation. Right now, the url system uses a bunch of elseif statements to determine what page to display to the user. If I put in a bad query (ie page.php?wrong instead of page.php?right) in my browser, I just get a blank page.

The elseif statements look like so (dont mind the messy code)...

PHP Code:
<?php
if(!$_SERVER['QUERY_STRING']) { ?> 

<?php
// blank query displays default page (index.php)
?>

<? elseif ($_SERVER['QUERY_STRING'] == "page"?>

<?php
// display page with index.php?page as url
?>
So, and especially in the future when I might be working with session id's for users (appended to the end of url's), how do I code it to look for bad queries? Thanks all.
I would recommend using a simple switch() statement:
Code:
<?php

    switch ($_SERVER['QUERY_STRING'])
    {
        case 'right':
            //display page
            break;

        default: //Anything not matched by the other cases (blank, wrong etc)
            //default page
    }

?>
hostfreak is offline  
Reply With Quote
Old 10-30-2007, 03:24 AM   #7 (permalink)
The Acquainted
 
obolus's Avatar
 
Join Date: Oct 2007
Location: florida
Posts: 110
Thanks: 36
obolus is on a distinguished road
Default

I already found a solution, but thanks for that tip!
obolus is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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


All times are GMT. The time now is 02:23 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0