When I use local computer using XAMPP my code is working fine but when I upload my webpage to the my InMotion Server it is not working.
Error shows
[object Object]
My Code:
$http.post("/aa/bb/public_html/php/checker.php",{"data1": val, "data2": para})
.then(function(response) {
if(para == "namedis"){
$scope.dsnamedis = response.data;
}else if(para == "namedise"){
$scope.dsnamedise = response.data;
}else if(para == "namein"){
$scope.dsnamein = response.data;
}else if(para == "namest"){
$scope.dsnamest = response.data;
}else if(para == "namemd"){
$scope.dsnamemd = response.data;
}else if(para == "namels"){
$scope.dsnamels = response.data;
}else if(para == "email"){
$scope.dsemail = response.data;
}else if(para == "pass"){
$scope.dspass = response.data;
}else if(para == "passc"){
$scope.dspassc = response.data;
}else if(para == "idno"){
$scope.dsidno = response.data;
}else if(para == "phoneno"){
$scope.dsphoneno = response.data;
}else{
}
}, function(error,status) {
$scope.fstatus = { message: error, status: status};
console.log(status);
});
My PHP Code:
<?php
$gc = file_get_contents("php://input");
$datas = json_decode($gc, true);
$cc = $datas['data1'];
$dd = $datas['data2'];
if($dd == "namedis"){
echo "<span class='text-danger'> <i class='fa fa-times-circle-o' aria-hidden='true'></i>aaaa.</span>";
}elseif($dd == "namedise"){
and so on
How to solve this problem.
When I remove the .htacess file it is working fine. How to work it with .htacess file.
RewriteBase /
DirectorySlash Off
DirectoryIndex disabled
RewriteEngine on
# prevent direct access to PHP files
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule \.php$ - [R=404,L]
# rewrite requests for a directory to index.php
RewriteCond %{REQUEST_FILENAME}/index.php -f
RewriteRule ^.*$ /$0/index.php [L]
Options -Indexes
ErrorDocument 403 /errors/403error.php
ErrorDocument 404 /errors/404error.php
public_htmldirectory on most hosts. That is the web root directory. Try changing url to"/php/checker.php"public_htmland thepublic_htmldirectory iteself. You can't do that. You can only access what is insidepublic_htmlaa.lk? Is that a directory insidepublic_htmland inside that is a directoryphp? Show us the directory structure inside public_html