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

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

MadButch
Forum Newbie
Posts: 6
Joined: Wed Mar 31, 2004 4:07 pm
Location: Netherlands

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

Post 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!
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post 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)
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

Don't use frames? It'd solve all your problems :)

CSS can do everything frames can.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post 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...
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

SEO.

But for a site like this, I don't think being in the results would matter much.
MadButch
Forum Newbie
Posts: 6
Joined: Wed Mar 31, 2004 4:07 pm
Location: Netherlands

Post 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...
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post 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.
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

Roja: like what? (things that aren't possible), i can only think of 1
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post 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
MadButch
Forum Newbie
Posts: 6
Joined: Wed Mar 31, 2004 4:07 pm
Location: Netherlands

Post 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 :)
Zay
Forum Newbie
Posts: 22
Joined: Tue Mar 23, 2004 3:42 pm

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

Post 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
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post 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
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Frames, however, are good in some instances - phpMyAdmin for example.

Mac
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post 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.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
Post Reply