Forum Moderators: coopster
I have recently started to learn PHP. I would like to know what peoples views are about PHP. Before i actually touched PHP i came across many sites that are PHP based and I used to get some sort of warning errors on the top of every page. I thought maybe it was a bug on PHP coz not everyone can have dodgy codes. From time to time i still come across many php based sites that generate some sort of warning error in the top of the page, what is this due to?
I would like to know this because i am building my website based on php includes etc. and i dont want to end up experiencing any errors after a month or so.
Any suggestions would be appreciated
Cheers
Linda
Not heard of that before - can you remember what the warning message says?
Also - what browser are you using?
Only other thing I can sugest is a site error where the author has included a page that does not reside at the specified locaton.
Mack.
[edited by: mack at 7:12 pm (utc) on June 30, 2003]
as for starting php - i really recommend learning it properly by following a book or tutorial - not downloading readymade scripts and trying to learn by editing them to do what you want to do... with the latter route lies not knowing important things about security, and a long hard route to being effective in php.
good luck :-)
I normally see this while I'm developing my own sites LOL. Does the error say something about Headers already sent? Not that it really matters. As noted above - it is most likely because of poor coding practices on the part of the programmer.
In general, I love PHP and there are only 2 other languages I'd like to learn that might surpass PHP for usefulness to me - PERL and C++.
Debatable, I stick to .html whenever possible but I have worked with tons of .php sites and could not attribute any adverse effect to the extension.
As to warnings on various sites. Warnings are from bad code. If you have warnings you should probably fix them. There are a million and one explanations/possibilities why these errors are appearing on page but all of them are the fault of the programmer.
fun job ;)
an advantage of using .php is google will support the?arguments
G will support, to the best of it's limited abilities, strings on html pages too but google has trouble with query strings in general so they should never be used.
As for errors, they are usually bad coding, but I have had a server change configurations on me and crash one of my scripts. I was using the UNIX dictionary for generating passwords. THey reconfigured and "forgot" to reinstall the dictionary.
This created an endless loop in my script :(
Also created a lot of unhappy clients and mega-nasty-grams:( :(
There is something to be said for learning how to build in decent error checking.
WBF
It's actually the script trying to send headers after having put out data to the client. Then these errors are displayed. There are two ways to get rid of them:
- check which headers will need to be sent during the script and send them all at once
- use ob_start();. This nifty function buffers the whole output until it encounters ob_end_flush();, that's when it sends all the buffered data to the browser. This has some advantages: sites display at once (except for images etc), and all headers are sent at the same time.
Good luck, and please do PHP, it's the best scripting language around, and it's free and opensource.