A few PHP questions

  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8416
  • Loc: USA

Post 3+ Months Ago

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.
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6254
  • Loc: Seattle, WA

Post 3+ Months Ago

You use 'extends' when creating a subclass.
You use 'implements' when implementing an interface.
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8416
  • Loc: USA

Post 3+ Months Ago

What is the use of it? I just don't understand...
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6254
  • Loc: Seattle, WA

Post 3+ Months Ago

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.
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8416
  • Loc: USA

Post 3+ Months Ago

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


Now on to my MAIL question... :D
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6254
  • Loc: Seattle, WA

Post 3+ Months Ago

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.
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8416
  • Loc: USA

Post 3+ Months Ago

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...
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8416
  • Loc: USA

Post 3+ Months Ago

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.
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6254
  • Loc: Seattle, WA

Post 3+ Months Ago

Installed on a server... as in a different server than your own?
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8416
  • Loc: USA

Post 3+ Months Ago

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.

Post Information

  • Total Posts in this topic: 10 posts
  • Users browsing this forum: No registered users and 72 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
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.