here’s the code!.Not working,Please help.
class user{
var idgen;
function uid(){
//return uniqid (rand(), true);
return "123";
}
function gen() {
$this->idgen=$this->uid();
//$this->idgen=udi();//even this dint work
}
function pint() {
echo "The id is :".$this->idgen;
}
}
$use= new user();
$use->gen();
$use->pint();
Change the second line of your code to
and voila! 🙂
BTW it’s worth setting error reporting on; it really helps debugging.
You can do it by editing the
php.inifile or adding this somewhere in your project:Put this in a file with other settings and include it in every page.