Thanks for all the replies. I'm sure they'll come in handy for me and others.If I'm making a usersystem or djpanel I usually kick off proceedings with my config file like so:
Then will come register and login, functions and so on.PHP Code:<?php
session_start();
$host = "localhost";
$dbuser = "dbuser";
$dbpass = "dbpass";
$dbname = "dbname";
$con = mysql_connect("$host","$dbuser","$dbpass")
or die(mysql_error());
mysql_select_db("$dbname",$con)
or die(mysql_error());
$logged_in = mysql_query("SELECT * FROM `table` WHERE `id` = '$_SESSION[id]' AND `password` = '$_SESSION[password]'");
$logged_in = mysql_fetch_array($logged_in);
$sitename = "Sitename";
?>![]()
For me the config file is the first file that should be made as it's connecting everything up to the database.
Back for a while.
That made me lul quite hard
OOP in php = lul, good method to learn OOP but PHP isn't even OOP yet (might need to wait till php 6 or 7). tbh if you wana do OOP go learn java
The only reason I think OOP should be used is if you have multi instances, eg a chat engine.
THIS PROBS SPARK UP SOME ARGUEMENTS
Last edited by Protege; 12-12-2008 at 09:37 PM.
Hi, names James. I am a web developer.
WOW? You were right about arguments.That made me lul quite hard
OOP in php = lul, good method to learn OOP but PHP isn't even OOP yet (might need to wait till php 6 or 7). tbh if you wana do OOP go learn java
The only reason I think OOP should be used is if you have multi instances, eg a chat engine.
THIS PROBS SPARK UP SOME ARGUEMENTS
How the hell can you even suggest PHP isn't OOP yet?
I don't really know you Protege, i only know you from your funny comments, but PHP is OOP. I promise you.
I'm guessing your a procedural programmer?
You where the last person i'd expect to spark up an argument, So tell me what you using OOP for in your scripts etc
Hi, names James. I am a web developer.
"The only reason I think OOP should be used is if you have multi instances, eg a chat engine."That made me lul quite hard
OOP in php = lul, good method to learn OOP but PHP isn't even OOP yet (might need to wait till php 6 or 7). tbh if you wana do OOP go learn java
The only reason I think OOP should be used is if you have multi instances, eg a chat engine.
THIS PROBS SPARK UP SOME ARGUEMENTS
You clearly have no idea what you are talking about...
I program in both Java and PHP and I can tell you that PHP is very much a OOP-capable language. The only thing it is really missing is namespaces which are due to be added very soon.
So before you go off on your rant you might like to check your facts.
http://muffinresearch.co.uk/archives...-the-benefits/That made me lul quite hard
OOP in php = lul, good method to learn OOP but PHP isn't even OOP yet (might need to wait till php 6 or 7). tbh if you wana do OOP go learn java
The only reason I think OOP should be used is if you have multi instances, eg a chat engine.
THIS PROBS SPARK UP SOME ARGUEMENTS
Haven't read it all, but:
"Procedural code can be messy and hard to adapt later on. I currently work within a team of several developers where on occasion I have to modify other developer’s code. It’s usually the scripts which have utilised classes which can be quickly understood and changes be made without having to spend too much picking apart the code line by line to understand the flow."
Seems pretty valid, if you are working on a site with more than one person.
Fair play, but tell me what's wrong with having different "function" pages instead of classes, why do you use a class instead of an ordinary page of functions.http://muffinresearch.co.uk/archives...-the-benefits/
Haven't read it all, but:
"Procedural code can be messy and hard to adapt later on. I currently work within a team of several developers where on occasion I have to modify other developer’s code. It’s usually the scripts which have utilised classes which can be quickly understood and changes be made without having to spend too much picking apart the code line by line to understand the flow."
Seems pretty valid, if you are working on a site with more than one person.
Just seeing your name i'd know you'd come up with some crap."The only reason I think OOP should be used is if you have multi instances, eg a chat engine."
You clearly have no idea what you are talking about...
I program in both Java and PHP and I can tell you that PHP is very much a OOP-capable language. The only thing it is really missing is namespaces which are due to be added very soon.
So before you go off on your rant you might like to check your facts.<- thats ranting
Same question as I asked Jackboy
So tell me what you using OOP for in your scripts etc
"So before you go off on your rant you might like to check your facts."
Why do I need to check my facts to give an opinion?
Last edited by Protege; 12-12-2008 at 09:56 PM.
Hi, names James. I am a web developer.
http://www.phpguru.org/article/classes-vs-functions
To be honest, I just followed it as the other coders seemed to use it, then I was told it's a more advanced way, and now I've just found out that it's faster.
Want to hide these adverts? Register an account for free!