Click to See Complete Forum and Search --> : PHPGmailer Help
cancer10
08-06-2008, 02:35 AM
Hi
My webhost has PHP 4 installed on their server and they are NOT ready to upgrade to PHP5. Anyways, this is not the issue here.
I need to make this script (PHPgmailer (http://www.vulgarisoip.com/category/phpgmailer/)) work on PHP 4, which means without any class.
So can someone please modify this script and make it without classes?
I will be really grateful to you.
(Attached is the zip file)
Thanx in advance
scragar
08-06-2008, 03:52 AM
...?
Why not download the version for PHP4, rather than asking someone to convert it?
http://sourceforge.net/project/showfiles.php?group_id=26031&package_id=17494
cancer10
08-06-2008, 05:57 AM
Unfortunately that is also written in class.
scragar
08-06-2008, 10:49 AM
PHP4 supports classes, some of the features are done differently though.
cancer10
08-06-2008, 11:35 AM
PHP4 supports classes, some of the features are done differently though.
Like for example?
NogDog
08-06-2008, 11:46 AM
You can do some quick comparing/contrasting by looking at:
Classes and Objects in PHP4 (http://us.php.net/manual/en/language.oop.php)
Classes and Objects in PHP5 (http://us.php.net/manual/en/language.oop5.php)
scragar
08-06-2008, 11:50 AM
fair number of differences, most obviously the fact that in PHP5 all things in a class have a visibility(public, protected or private), where as in PHP4 all things in the class are public, nothing can be done to change it.
PHP5 also let's you also use class constants, which are similar to global constants via define() however they are accessible only inside the class.
On a similar note PHP5 introduced the static method, which allows a variable to remain accessible across all instances of the same class, yet still not be global.
PHP5 passes all classes by reference, instead of the PHP4 default of duplicating the class if you assigned it to something$x = new MyClass();
$x->something = 'foo';
$y = $x;
$y->something = 'bar';
echo $x->something;// in PHP5 you get 'bar', in PHP4 you get 'foo'
this isn't anywhere near a complete list BTW, it's just the big hitters in my mind.