php


Can`t get returned boolean value from class function call


I cant get returned value from php function call.
...
$dey=$validate->yoxla($this->ad,$this->soyad,$this->istadi,$this->sifre,$this->email);
if($dey){ // i cant get returned value from here. even it is true.
echo 'asd';
if(!$checkuser->checkusername($this->istadi)){
$err=array();
$err['code']='code14';
$err['aciglama']=$code14;
print json_encode($err);
die();
}elseif(!$checkuser->checkemail($this->email)){
$err=array();
$err['code']='code15';
$err['aciglama']=$code15;
print json_encode($err);
die();
}else{
$err=array();
$err['code']='acig';
print json_encode($err);
die();
}
}
yoxla() function:
...
elseif (!preg_match("/^.*(?=.{8,})(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).*$/", $sifre)){
$err=array();
$err['code']='code11';
$err['aciglama']=$code11;
print json_encode($err);
die();
}elseif($email==""){
$err=array();
$err['code']='code12';
$err['aciglama']=$code12;
print json_encode($err);
die();
}elseif (!$this->validEmail($email)) {
$err=array();
$err['code']='code13';
$err['aciglama']=$code13;
print json_encode($err);
die();
}else{
return true;
}
I call first one by ajax request. and there is nothing returning to ajax or i cant get returned value from getresult() function.
Remove () from From class declaration :
try this :
class Form{
public function getresult(){
return true;
}
}
$validate=new Form();
$result=$validate->getresult();
if($result){
echo 'true';
}else{
echo 'false';
}
Enable php error logging so that you could understand such errors on browser : http://php.net/manual/en/function.error-reporting.php

Related Links

Parse XML in PHP error
Rewrite causing 404
Omit / ignore any records that have been purchased by a user
Multiplication error in php
Php mvc not loading images using <img>
Storing records in array [closed]
HTML-PHP code error
Yii ORDER column data in view
header function open the source code of the page
Sql, about find how much customers
A Logical Algorithm In PHP
php RecursiveDirectoryIterator show only folder and subfoldernames
Laravel 4 creating form open with database
PHP mongo aggregation: match multiple values on same field
SimpleXml and php Iteration
How to compare two arrays element by element using for loops?

Categories

HOME
google-chrome
knockout.js
compilation
cypher
ontology
dji-sdk
openfoam
tweepy
tfs2010
clickable-image
siesta
cqrs
smartgwt
async-await
http-authentication
bluemix-mobile-services
web-push
high-availability
prompt
window-managers
fstar
xdebug
matlab-app-designer
mapnik
seafile-server
shapeless
ms-media-foundation
numerics
flowchart
secure-coding
optionaldataexception
fluid-mac-app-engine
nomad
qvtkwidget
windows-media-player
cyanogenmod
head.js
lightning-workbench
comm
solr-query-syntax
algebra
test-data
kendo-editor
mechanicalturk
d3v4
email-injection
oracle-fusion-apps
haraka
controllers
java-2d
callouts
right-to-left
adjacency-list
facebook-ios-sdk
openmrs
vim-plugin
cryptojs
openshift-cartridge
netdatacontractserializer
knife
supersocket.net
replicaset
roxygen2
org-babel
componentart
dbmigrate
console.log
nsmutabledata
findersync
string.format
cakephp-2.2
image-rotation
multivariate-testing
distributed-r
nachos
gpu-programming
cpu-time
jms-serializer
particle-swarm
compiler-flags
ax
objective-c-runtime
microformats
chartfx
axacropdf
spark-view-engine
stretch
autosize
dropshadow
affinetransform
startupscript
upshot
asp.net-mvc-views
bll
suphp
self-tracking-entities
iphone-sdk-3.1.3
activex-exe
webclient.uploaddata

Resources

Encrypt Message