-1
Controller für Sign-upIonic Angular - Anmelden Probleme
.controller('signupCtrl',
function($scope,$http,$ionicPopup,$state,$ionicHistory) {
$scope.signup=function(data){
var link = 'http://localhost/b_data/server/signup.php';
$http.post(link, {n : data.name, un : data.username, ps : data.password , ph: data.phone , add : data.address , pin : data.pincode })
.then(function (res){
$scope.response = res.data.result;
if($scope.response.created=="1"){
$scope.title="Account Created!";
$scope.template="Your account has been successfully created!";
//no back option
$ionicHistory.nextViewOptions({
disableAnimate: true,
disableBack: true
});
$state.go('login', {}, {location: "replace", reload: true});
}else if($scope.response.exists=="1"){
$scope.title="Email Already exists";
$scope.template="Please click forgot password if necessary";
}else{
$scope.title="Failed";
$scope.template="Contact Our Technical Team";
}
var alertPopup = $ionicPopup.alert({
title: $scope.title,
template: $scope.template
});
});
}
})
Backend signup.php paar Zeilen
if(isset($_GET["n"]) && isset($_GET["un"])&& isset($_GET["ps"])&& isset($_GET["ph"])&& isset($_GET["add"])&& isset($_GET["pin"])) {
if(!empty($_GET["n"]) && !empty($_GET["un"])&& !empty($_GET["ps"])&& !empty($_GET["ph"])&& !empty($_GET["add"])&& !empty($_GET["pin"]) ){
//rest of my db saving code
} }
Wie pro Debuggen gibt es kein Problem, das ich in dem Winkel sowie PHP-Code gefunden, beim Debuggen fand ich in PHP $ _GET ['n'] funktioniert nicht, so dass der Rest von Codes erhalten.
Sortieren Sie diese aus.
Danke, für zu bemerken. Ich habe den gleichen Fehler versucht. –
Wenn Sie $ _POST verwenden, ist das Format anders. Lass mich meine Antwort aktualisieren. – digit
Ja, bitte aktualisieren Sie die Antwort, so dass ich dieses Problem sortieren kann –