A few PHP questions

  • Bogey
  • Bogey
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 8212
  • Loc: USA
  • Status: Offline

Post January 25th, 2009, 9:44 pm

Alright, I got a few PHP related questions. I know I am probably annoying here since a lot of my questions goes unanswered :roll: but I'll try anyway :)

I know what 'extends' does in a class (e.g: class db extends functions ) but I'm not sure what 'implements' does (e.g: class db implements sessions). Any one care to explain that to me?



Alright, here's the more difficult question. I need to create a mail class that uses SMTP and NOT the 'mail' function as my host doesn't allow it. I don't want to use PEAR I just want to create a class and use it. Any tutorials out there for this type of thing? Thanks.
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post January 25th, 2009, 9:44 pm

  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Joined: Sep 22, 2003
  • Posts: 6134
  • Loc: Seattle, WA
  • Status: Offline

Post January 25th, 2009, 11:40 pm

You use 'extends' when creating a subclass.
You use 'implements' when implementing an interface.
The Beer Monocle. Classy.
  • Bogey
  • Bogey
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 8212
  • Loc: USA
  • Status: Offline

Post January 26th, 2009, 5:44 pm

What is the use of it? I just don't understand...
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Joined: Sep 22, 2003
  • Posts: 6134
  • Loc: Seattle, WA
  • Status: Offline

Post January 26th, 2009, 6:10 pm

You should read up more on object-oriented programming then. There's no easy way to explain interfaces without a decent understanding of OOP as a whole.

Basically, an interface lets you define what kind of behaviors a class should have without actually defining how those behaviors actually work. Then, objects of classes that implement the interface can be interchanged with each other without the need for the application to know the difference between them.
The Beer Monocle. Classy.
  • Bogey
  • Bogey
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 8212
  • Loc: USA
  • Status: Offline

Post January 26th, 2009, 6:43 pm

Alright... I'll read more on OOP then. Thanks spork.


Now on to my MAIL question... :D
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Joined: Sep 22, 2003
  • Posts: 6134
  • Loc: Seattle, WA
  • Status: Offline

Post January 26th, 2009, 9:01 pm

PHP's mail() function does use SMTP; if your host has it blocked then there's a good chance they'll have the SMTP ports blocked as well.
The Beer Monocle. Classy.
  • Bogey
  • Bogey
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 8212
  • Loc: USA
  • Status: Offline

Post January 26th, 2009, 9:17 pm

They said that mail() is blocked due to abuse, but they allow SMTP... they suggested a PEAR one, but I want to create my own...
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • Bogey
  • Bogey
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 8212
  • Loc: USA
  • Status: Offline

Post January 26th, 2009, 9:18 pm

That aside for now, I got a different question... how can I check which hashing algorithms are installed on a server and put those in an array?

hash_algos(); doesn't give me what I want... I need to know which ones are actually available on a server.
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Joined: Sep 22, 2003
  • Posts: 6134
  • Loc: Seattle, WA
  • Status: Offline

Post January 26th, 2009, 11:20 pm

Installed on a server... as in a different server than your own?
The Beer Monocle. Classy.
  • Bogey
  • Bogey
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 8212
  • Loc: USA
  • Status: Offline

Post January 27th, 2009, 2:43 pm

The server that the script is hosted on. Not so that the script would check another server then the one that it's hosted at (or served :D)

Anyways and basically... yes. Not my local 127.0.0.1 server, but the one that it is hosted on.
"Bring forth therefore fruits meet for repentance:" Matthew 3:8

Post Information

  • Total Posts in this topic: 10 posts
  • Users browsing this forum: No registered users and 188 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.