What is the most pointless use of PHP?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
gotDNS
Forum Contributor
Posts: 217
Joined: Tue May 07, 2002 5:53 pm
Location: West Chester, PA

What is the most pointless use of PHP?

Post by gotDNS »

What does everyone think the most pointless use of PHP is?

Just wondering.

I'd say for, oh say, someone making a site about their cat and wanting to put in a login that says "wow, like my login? (how about my cat!?)"
User avatar
cwcollins
Forum Commoner
Posts: 79
Joined: Thu May 16, 2002 3:51 pm
Location: Milwaukee, WI, USA

Post by cwcollins »

i may offend some people here, but i thnk using php to do simple form validation (is X field not empty) is silly. why wait for another page to load when you can just use a pretty simple bit a JavaScript? It's faster, and easier on the server.

-c.w.collins
User avatar
gotDNS
Forum Contributor
Posts: 217
Joined: Tue May 07, 2002 5:53 pm
Location: West Chester, PA

Post by gotDNS »

Remember kids, when using JS, make sure you test it on every browser you've ever heard of!
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

i do that cwcollins :evil:
why? well cos i want learn php and i wanna know all the functions of it :)
it is just for fun. :D

useless use?
hmm, i'd say buying a book about php and then smashing it on your head cos u don't understand it :P
User avatar
cwcollins
Forum Commoner
Posts: 79
Joined: Thu May 16, 2002 3:51 pm
Location: Milwaukee, WI, USA

Post by cwcollins »

gotDNS wrote:Remember kids, when using JS, make sure you test it on every browser you've ever heard of!
unless you are working in a controlled environment :). While this certainly can lead to lazy programming, it does make things so much easier.

good point, though, gotDNS.

c.w.collins
jason
Site Admin
Posts: 1767
Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:

Post by jason »

Also considering you don't want people with JavaScript turned off. The problem with controlled environments is that they are rarely controlled, even if you develop for intranets. Trust me, I have worked on them.

You can't assume for a moment everyone will be using the same browser. Using PHP for form validation is a rather responsible task, and one which isn't done enough.
User avatar
zorka
Forum Newbie
Posts: 9
Joined: Fri May 24, 2002 8:29 am
Contact:

Yep...

Post by zorka »

You cannot trust that the user has java script turned on. He/she might be using some unknown obscure beta relase of some new Linux browser that doesn't even support java script.

--ZorKa
User avatar
mikeq
Forum Regular
Posts: 512
Joined: Fri May 03, 2002 3:33 am
Location: Edinburgh, Scotland

Post by mikeq »

Agreed, you can't always rely on JavaScript being there, you should always vaildate the data at the server (in addition to frontend checking) or you end up with a lot of crap data in your database.
User avatar
enygma
Site Admin
Posts: 175
Joined: Fri Apr 19, 2002 8:29 am
Location: Dallas, Tx

Post by enygma »

most pointless? PHP template engines....*sigh*
Sergiy
Forum Newbie
Posts: 6
Joined: Mon Jun 03, 2002 3:00 am
Location: Kharkiv, UA
Contact:

Post by Sergiy »

besides that... there are many evil hackers :twisted: who just dream of cracking your site...

they definitely will not use JavaScript checking :P
User avatar
cwcollins
Forum Commoner
Posts: 79
Joined: Thu May 16, 2002 3:51 pm
Location: Milwaukee, WI, USA

Post by cwcollins »

ok, so was wrong about the JS form validation thing, but what's wrong with template engines?
enygma wrote:most pointless? PHP template engines....*sigh*
c.w.collins
User avatar
enygma
Site Admin
Posts: 175
Joined: Fri Apr 19, 2002 8:29 am
Location: Dallas, Tx

Post by enygma »

they're silly when the same thing could be done with just PHP....

Why cater to people who will, more than likely, make pretty bad web pages because they are too lazy to really learn PHP?
User avatar
cwcollins
Forum Commoner
Posts: 79
Joined: Thu May 16, 2002 3:51 pm
Location: Milwaukee, WI, USA

Post by cwcollins »

what about using templates within a CMS framework? wouldn't this be a good way to prevent people from making nasty pages?
user: i want to make a webpage for my department
admin: ok, here are the templates you have to choose from. you can change the content, but you can not modify the layout or the color scheme.
user: ok. but i want to make this line bigger, and red and flashing.
admin: sorry, that is not available in these templates.
c.w.collins
User avatar
zorka
Forum Newbie
Posts: 9
Joined: Fri May 24, 2002 8:29 am
Contact:

Post by zorka »

cwcollins wrote:ok, so was wrong about the JS form validation thing, but what's wrong with template engines?
enygma wrote:most pointless? PHP template engines....*sigh*
c.w.collins

The bigger problem with PHP template engines is they cause more work for web designers and developers since you have to learn "their" tags. Why not just use industry standard tags for god sakes? There are also speed concerns that template engines add because all of the code has to be doubly parsed and executed. Also, (not that I have tested it) but I using Dreamweaver and those tools would definitely not be compatable with these add-hoc templating engines.

--ZorKa
User avatar
cwcollins
Forum Commoner
Posts: 79
Joined: Thu May 16, 2002 3:51 pm
Location: Milwaukee, WI, USA

Post by cwcollins »

maaybe this is a foolish question, but how would you implement a content management system, if not by using something at least akin to templates?

is the issue that templates are a bad idea, or that bulky, difficult to use template engines are a bad idea?

c.w.collins
Post Reply