Page 1 of 3

My first PHP site, pointers/tips/tricks/feedback welcomed :)

Posted: Wed Mar 31, 2004 4:07 pm
by MadButch
Hello everyone.

Recently I was working on our old roster for everquest (cgi with ascii file for database) and I got an urge to try something new. I decided to go for PHP with MySQL, installed all the necessities and started on the site.

Some background info. I'm a C++ coder (business apps for work, games for fun) and always up to a nice new challenge :).

Most things went farely well, thanks to the great manual at http://www.php.net and thanks to the fact that the code was so intuitive (and C++ like stylewise). I've spend around 60 to 70 hours on it so far.

I use the index page to create 2 frames, the header logo and the body.
The actual pages show in the body, and mostly consist of a header, body and footer. It was tricky to get it all working (you all know of the frames trouble of course), but by making the page that created the frames a PHP script to, and submitting the body page it called back to that frames page, I got it all working. And the end result is much much more user friendly then our old roster.

I tried to show a LOADING screen/image for when the main PHP script is generating that huge character overview, but I couldn't get it working. I know it must be possible, because PHPMyAdmin does it to.

When loading the page, the flash logo (header frame) shows up immediatly, but the body frame first shows up as the default browser background color. When clicking a column for a new sort order, it again first displays the default browser background color, before showing the black background. I didn't find out how to fix this (if at all possible).

I also still have to create a session when the user logs in. That way I can make sure someone is really logged in when trying to update his/her characters, and not just hacking the site using the ?name= lines.

I also would have liked it if the PHP files didn't show in the status bar of the browser, but never found out how to do that (didn't look that hard either :oops: ).


If you would like to take a look at my site, and maybe post some feedback here, that'd be greatly appreciated.
Here is the link to my side (please view full-screen for best effect):
http://www.gameplayheaven.com/eqroster/
And here is a zip containing all the code:
http://www.gameplayheaven.com/downloads ... roster.zip

Many thanks in advance for your time!

Posted: Wed Mar 31, 2004 6:42 pm
by m3mn0n
Welcome to the community.

Cool site you have. Nice to see things are going well without too many serious problems. :)

(moving this to General Talk)

Posted: Wed Mar 31, 2004 6:57 pm
by d3ad1ysp0rk
Don't use frames? It'd solve all your problems :)

CSS can do everything frames can.

Posted: Wed Mar 31, 2004 7:03 pm
by Weirdan
LiLpunkSkateR wrote:Don't use frames
Why? It seems that almost everyone here anticipate frames, but I haven't seen any coherent explanation for such a prejudice...

Posted: Wed Mar 31, 2004 8:06 pm
by m3mn0n
SEO.

But for a site like this, I don't think being in the results would matter much.

Posted: Thu Apr 01, 2004 12:22 am
by MadButch
Thanks for the responses so far. I'm sorry I posted in the wrong forum =/

I had no clue CSS could be used instead of frames, and I have totally no clue what SOE is. Which means I got some new research to do :)
Thanks for the heads up so far...

Posted: Thu Apr 01, 2004 8:44 am
by Roja
Weirdan wrote:
LiLpunkSkateR wrote:Don't use frames
Why? It seems that almost everyone here anticipate frames, but I haven't seen any coherent explanation for such a prejudice...
A little off-topic, but might be helpful to people.

First and foremost, they break fundamental modes of web-browsing. Back/forward buttons don't work consistently with normal web-browsing paradigms.

It makes printing difficult - the default prints the current main frame, not the full frameset (if that even, different browsers implement this slightly different depending on design).

You often can't bookmark any page other than the root - again, depending on browser implementation.

Search engines can't index them correctly - leading to poor ratings.

Depending on the design, users might get caught in your frameset, even when clicking on outside sites.

If the browser doesnt support frames, it will literally replace it with nothing - often completely breaking the design. ie, it doesnt 'degrade' gracefully.

Some good resources about it:
http://www.htmlhelp.com/design/frames/whatswrong.html
http://www.useit.com/alertbox/9612.html

Now, I will say that while 99% of what you'd like to do with frames can be done with CSS, I *have* found a tiny few things that werent possible without frames.

So, there are lots of solid reasons not to use them, and few good reasons to do so.

Posted: Thu Apr 01, 2004 2:56 pm
by d3ad1ysp0rk
Roja: like what? (things that aren't possible), i can only think of 1

Posted: Thu Apr 01, 2004 3:44 pm
by ol4pr0
Frames can be c00l, however in the frame on the index. page ( lets call it the footer.php ) you have forgotten to disable the scrolll=no ;-)

That just my opinion. besides that looks kinda c00l

edit: Frames ( header.php and the footer.php ) thats how i just call it lol

the frame with the menu links on the top and the frame with the frame with the menu links on the bottum


And in response of the frame argument: IF you like to kill the spiderb0ts and all other like them frames are a very fun ¨tool¨ to kill those b0ts

Posted: Thu Apr 01, 2004 3:54 pm
by MadButch
I had those on "no" first, but put them back on auto, because otherwise the width of the header was different (wider) then the width of my body.
Since the header and body are supposed to looke like one table (just in different frames), I made them both auto so they had the same width.

The idea was to eventually but the header back to "no" again, and to calculate the width of the header by hand (window width minus scrollbar width).

not sure why the footer is auto... that must have sneeked in :)

Re: My first PHP site, pointers/tips/tricks/feedback welcome

Posted: Fri Apr 02, 2004 1:23 am
by Zay
MadButch wrote: I tried to show a LOADING screen/image for when the main PHP script is generating that huge character overview, but I couldn't get it working. I know it must be possible, because PHPMyAdmin does it to.

When loading the page, the flash logo (header frame) shows up immediatly, but the body frame first shows up as the default browser background color. When clicking a column for a new sort order, it again first displays the default browser background color, before showing the black background. I didn't find out how to fix this (if at all possible).
you should take a look at output buffering for the loading.
here's the general way it works:

- output the loading image
- start output buffering
- do all your stuff including echo's/prints (they will not show up yet)
- then stop output buffering, all will appear at once.

this is also handy if you want to load big images from db for instance and don't want the user to see a halfblurred image ;)

in fact it can be usefull for just about everything.

MadButch wrote: I also would have liked it if the PHP files didn't show in the status bar of the browser, but never found out how to do that (didn't look that hard either :oops: ).
you mean with a link?

Code: Select all

<a href="blah.php" onmouseover="window.status='teehee, you can''t see my link :P';">
hope it helped

Posted: Fri Apr 02, 2004 4:17 am
by malcolmboston
frames are horrible seriously

its so, i hate this word but, nooby.

as Roja stated basic css eliminates the need for frames (as does the include() function, frames imho are for lazy designers with no sense of design, CSS2 does what frames can and much more

just my $0.02

Posted: Fri Apr 02, 2004 4:24 am
by twigletmac
Frames, however, are good in some instances - phpMyAdmin for example.

Mac

Posted: Fri Apr 02, 2004 4:29 am
by malcolmboston
PHPmyadmin could of functioned exactly the same though without the use of frames, its just sheer laziness on the designers part.

first time i ever designed a web-site was around 6 years ago, i used frames and i liked them at the time, as you become more 'proficient' and realise the reality of web standards and accessibility then something should tell you in your head frames are not the way to go, last time i attempted to use frames was around a year ago, and they still suck

i cant stress it enough, if your a 'newcomer' to the web-design industry, get into good coding habits from the off, do not use frames unless absolutely necessary.

Posted: Fri Apr 02, 2004 4:35 am
by twigletmac
malcolmboston wrote:PHPmyadmin could of functioned exactly the same though without the use of frames, its just sheer laziness on the designers part.
Of course it could have functioned the same - just would have been a lot of uncessary reloading of data.

Mac