Sir,
I actually come across this coding
<?php
include "classes.class";
$objP= new Page;
$objP->disp( );
?>
;-)
whether it is possiblt to include classes as .class file please explain me.
ArunKumar
| SitePoint Sponsor |




Sir,
I actually come across this coding
<?php
include "classes.class";
$objP= new Page;
$objP->disp( );
?>
;-)
whether it is possiblt to include classes as .class file please explain me.
ArunKumar
Where there is a will there is a way![]()
ArunKumar





It isn't required for an include file to have a .php file extension. However, just be aware that if it doesn't, anyone would be able to read the file.
Music Around The World - Collecting tips, trade
and want lists, album reviews, & more
Showcase your music collection on the Web




How can i create a class file in php or it is a java class file.
ArunKumar
Where there is a will there is a way![]()
ArunKumar





Here is a very general format for creating a class in PHP.
Code:<?php class ClassName { var $var1; var $var2; ... //The constructor function function ClassName(variable list here) { $this->var1 = $var1; .... $this->ClassFunction(); } function ClassFunction() { //Do something here } function getClassVars() { // Return variables to the calling function } } ?>
Music Around The World - Collecting tips, trade
and want lists, album reviews, & more
Showcase your music collection on the Web




after this is i have to save as .class extension? am i right
ArunKumar
Where there is a will there is a way![]()
ArunKumar





Save your class with a .php file extension. That prevents being able to read the raw script.
Music Around The World - Collecting tips, trade
and want lists, album reviews, & more
Showcase your music collection on the Web
Bookmarks