Ionic 3 Angular 4 PHP Token Based Restful API User Authentication Login and Signup.
HTML-код
- Опубликовано: 20 июн 2017
- PHP Restful API Authentication Login and Signup using Ionic 3 and Angular 4.
Next Part: • Ionic 3 Angular 4 JSON...
Resource link: www.9lessons.info/2017/06/ioni... Наука
Very good tutorial! Current version of Ionic takes care of importing new providers, so you don't need to import it manually.
Hi, Very good tutorial. I'am a french people and i like very much. continue in this way
Great lesson. Thank you Srinivas.
Very Good explanation.... Excellent. Thank you so much Sir.
great lesson!!!
Excellent tutorials.. You earned one more subscriber... *thumbs up*
Thks Tamada this video is so usefull to me so you got another subscriber
Thank you sir. It's working fine. Good job
Excellent tutorials..
great job.... keep post more videos
Very useful! Thanks
You are the best!
nice tutorial....
This always returns a '200 OK' so never errors. How do you pass an error response in slim, whilst Echoing out?
It always allows access.
For everyone having the JSON error, I'm not sure if this is the correct solution, but I got it without errors by doing this:
1 - go to your index.php in the api folder
2 - check the signup function: function signup()
3 - delete or comment the following 'echo' lines:
echo $email_check.''.$email;
echo 'here';
4 - save the index.php
5 - refresh the app and try again
Thank +Igor ;)
i got this error from XHR please help
{error: {text: "Enter valid data"}}
error
:
{text: "Enter valid data"}
text
:
"Enter valid data"
Helpfull......................
How do i fix Unexpected token S in JSON at position 17 in signup() function?
wow thank you, i'll try later
why u didn't use the @output to emmit the data to parent component instead of storing them in the localStorage ?
anyone facing this problem : after generating .apk file and opening it it displays white screen only ..no login form no sign form ..but in browser it's work well ..when am testing my app in ionicDevApp it gives me "syntex error" : "unexpected token Illegal" please help me .. my xampp is open and started on my pc
bonjour,
je n'arrive pas a faire fonctionner postman, à chaque fois erreur de proxy ou objet introuvable? quel sont les paramètres pour que ça fonctionne? est ce que c'est une étape obligatoire?
merci d'avance.
Great!
Hi I am getting this error
Can't bind to '{ngModel}' since it isn't a known property of 'ion-input'.
i got this error
status: 0, statusText: "Unknown Error", url: null, ok:false, name: "HttpErrorResponse", message: "Http failure response for (unknown url): 0 Unknown Error"
I guess it's a CORS failure because of the status = 0 but idk how to solve it, any help ?
great tuts, but I wanna use a different database what changes should make and to what files... thanks
hello sir, you have done a good job, but now the `ionic start --v2 ionic-welcome tabs` command is not working, I tried to follow your tutorials with ionic version 3 and the value is inserting in database properly but it gives an error i.e, "message": "Property 'json' does not exist on type 'Object'.", it is coming from auth-service.ts...
is there any solution?
Please how can I use Material design library with my ionic3/angular4 ? Need help
I tried to run your app with ionic serves, and I can not, says it's giving ionic error-app-scripts, could you help me?
hello friend I have the following problem [ts] The property 'json' does not exist in the type 'Object'. any could you help me
Hello sir, thanks for the superb tutorial but as of now i am having a problem after implementing logout function as you did i get error the time i click on logout button "(getRootNav) is deprecated and will be removed in the next major release" how to fix this issue?
Thanks! do you know anyone framework for ASP.NET back-end just like PHP-Slim-Restful?
Hey, i got this error
when i push the botton of login in the console show me that "Object { error: Object }" can anyone help me with that..?
i'm having a problem with the signup.ts, the user registration info successfully stored in database BUT it seem that it cannot go to Tabspage, it stuck at the signup page after clicked signup button..
great tutorial thank you! instead of using the localStorage can I use ionic's event handler (publish/subscribe)?
Yes you can
very good my friend! do you know how to do the same using rails 5 as API? I don't find nothing talking about with ionic 3... Do you have some link or any idea? i'm trying with "Rack Cors" Gem but i just found with ionic v1.. thanks man.
excellent tutorial..
can we integrate ccavenue and payumoney with ionic ?
in the documentation i can find only paypal
I found a solution for the JSON error saying {error: {text: "Enter valid data"}}
try putting username that is alphanumeric and other attributes in the table are set into VARCHAR in which some inputs must be alphanumeric to be accepted.
hello friend, I find it excellent what you explain here, and thank you for it.
I have a doubt that I would be grateful if you could solve it ...
I noticed that when a name is repeated in the database, an error is generated in the registry ... to which this question arises, as it would notify the user if it has already been registered previously and avoid that error but a message onscreen
sir how if if user already exists?
I got this error im using (responded with a status of 415 (Unsupported Media Type))........
Mr.srinivas can you help me regarding this issue.
using latest ionic (ionic 3 and angular 5) need to import HttpClientModule
i got this error
Runtime ErrorUnexpected end of JSON input
and i wrote same code any help?
facing same issue .. Have you resolved it yet ?? Need Help
here too, can someone help?
hi Ayub Idrees,
Vinicius Oliveira
Have both og you got any solution on this same problem ?if yes please help me, i am dealing with same issue
1 - go to your index.php in the api folder
2 - check the signup function: function signup()
3 - delete or comment the following 'echo' lines:
echo $email_check.''.$email;
echo 'here';
4 - save the index.php
5 - refresh the app and try again
nice
How to get this vs code intelligence plugin?!
thank you for your help ,, i have problem i used ionic 5 with angular 9 when i want to add the code in signup.ts Page and in authservice.ts Page there is error at postData ... pls help me i have final year project
Hi... I have a problen adding property "Authorization: Bearer myToken" into HttpHeaders, when i create "let header = new HttpHeaders();" and i do "header.set('Authorization', Bearer myToken)" (or .append(...) ), I get status=401, statusText: "Unauthorized" and not find property Authorization in header object... But when i create directly on "let header = new HttpHeaders({'Authorization': this.TokenType + ' ' + this.AuthToken})" i get status=0, statusText: "Unknown Error"... Can Anyone help me.
I found de solution. I've changed on backend (lumen 5.6) the file "public/index.php", adding two lines:
hi srinivas,
why my signup button can not working??
no error massage there and i do as you do
I am having the same issue. Did you find a solution?
Showing Error in signup.ts file
Error: Uncaught (in promise): Error: StaticInjectorError(AppModule)[AuthServiceProvider -> HttpClient]:
StaticInjectorError(Platform: core)[AuthServiceProvider -> HttpClient]:
NullInjectorError: No provider for HttpClient!
cross origin request blocked. (Reason : CORS header 'acces-control-allow-origin' missing)
Sir this is my issue, can you solve thid?
Im with this issue. Did you solve it?
Download the cors extension from chrome webstore and it will solve your problem.
If your requesting it from browser than you have to allow cross origin you can enable that using this extension for chrome chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi?hl=en
@@lucianaelisa9501 If your requesting it from browser than you have to allow cross origin you can enable that using this extension for chrome chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi?hl=en
good tutorial....can you please help me in writing the registration and login without Slim framwork. I want to use someother php framework.
did you get the solution
Thanks for the video, but at the end while clicking on signup button i am getting following error, please help me resolve it.
Error:
SyntaxError: Unexpected token < in JSON at position 0
hi, do you know the solution? I'm also facing this error
Great and very useful tutorial, but I am having a problem in the home.html, when I use the line
Welcome to {{userDetails.name}} send me this error _co.usersDetails is undefinied.
I expect someone can help me.
help. how to set up the app page for wrong login credential instead of showing: Uncaught (in promise): TypeError: Cannot read property 'user_id' of undefined TypeError. I am trying to set up the error to show on an ion-card but how to stop the page from going to the runtime error page. I use res["_body"];
never mind. i fixed it :D
how please help
Hi! I'm getting the same error. how did you fix it?
Hello tamada and thank you for this series of video.
It really helps me to take Ionic ionic 3. but I have
all encountered some problems. I followed this video
to the letter and the execution was perfect.
But soon after nothing except this console error when I try to login or register
?ionicplatform=ios&ionicstatusbarpadding=true&localhost:8100/ionic-lab:1 XMLHttpRequest cannot load localhost/PHP-Slim-Restful/api/login. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'localhost:8100' is therefore not allowed access. The response had HTTP status code 500.
Cyprien Dontsa try to active headers_module on wamp
Awesome tutorial but .. im having error says that "Uncaught (in promise): TypeErroe: this.userDetails is undefined HomePage@........ Please Help me !
Clear your browser local storage and try. Go to developer tools -> application -> Clear Site Data
how to get the api folder ?
please make a tutorial to function checking for login
i followed the instructions like in the video, but if i click the Signup Button nothing happens
the api works with the postman but not in the app itselve
anybody can help me?
in the console i geht the message: Hello AuthServiceProvider Provider
so i think my authservice works but not the signup function itselfe
I am having the same issue. Did you find a solution?
How did you manage to make HTML request from web browser ?
Just BCOZ of nodeJS .. happy codeing :)
Is this app available on playstore?
My Slim api not run, error $app-> run row 12, file index.php?? Please help me
Cross verify your require 'Slim/Slim.php'; file path
Sir api not working in my wamp server please help me
please upload tutorial for menu session users from ionic
I have an error when I used postman, 500 Internal Server Error. Can you help me?
Enable mod_rewrite extension for PHP, this will helps you to run the .htaccess file for friendly URL APIs
The extension is activate but i still have 500 Internale Server Error.
click on your wamp icon -> apache -> httpd.conf -> and then remove the # before LoadModule headers_module modules/mod_headers.so
@@mariamcheikh540 still shows error! do you have a solution?
thanks for this video but I have a question. How to transfer from another database? It has an error when I change the db name
maybe this is because of the clone in github?how to fix this?
Enable your localhost URL in src/providers/auth-service.ts
let apiUrl = "localhost/PHP-Slim-Restful/api/";
//let apiUrl = 'api.thewallscript.com/restful/';
I already enable it but still error
let apiUrl = 'localhost/PHP-Slim-Restful/api/';
Configure your PHP API project with your local database.
and now its totally not running :( , the app is totally broken
when i post through POSTMAN to my localhost:82/api/signup I got this error : {"error":{"text":SQLSTATE[HY000] [2006] MySQL server has gone away}}
What can I do ?
Please Help!
Try to check your MySQL configurations like username, password etc
all are correct!
all are ccrrect and the same errors
it works now, I removed :82 from localhost
thanks
Hey, i have this issue
Uncaught (in promise) : [object Object]
can u help me convert my php mysql ecommerce website to ionic 3 app or can you update ionic 1 app with mysql database backend to ionic 3 ..waiting for your response
Can you please send the details to srinivas@9lessons.info
Ok sir I will send it shortly
i have sent it already sir with my email ashekfree@yahoo.com
help please :
POST localhost/PHP-Slim-Restful-master/api/signup 500 (Internal Server Error)
Failed to load localhost/PHP-Slim-Restful-master/api/signup: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'localhost:8100' is therefore not allowed access. The response had HTTP status code 500.
with postman :
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at admin@example.com to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Apache/2.4.9 (Win32) PHP/5.5.12 Server at localhost Port 80
help me !!!!!!
{error: {text: "Enter valid data"}}
error
:
{text: "Enter valid data"}
text
:
"Enter valid data"
i got this error from XHR please help :
i got the same error, have you fixed it?
Great tutorial man.
I get this error:
404 Page Not Found
The page you are looking for could not be found. Check the address bar to ensure your URL is spelled correctly. If all else fails, you can visit our home page at the link below.
Could it be firewall?
sorted. localhost:/PHP-Slim-Restful/api/signup
if you directly try to run api.php then this will happen.. its a PHP SLIM thing.
Hey man, please make a tutorial to receiver data from firebase in ionic 3
please, please, please???
Can you rely for production level app on firebase? Learning PHP API is always better,
can you share the php file?
php file into $git clone github.com/srinivastamada/PHP-Slim-Restful.git
can you explain me how to use the api? Do i have to save it somewhere in htdocs in the xaamp folder?
I make GET request successful but POST i get errror: OPTIONS localhost/hoofapi/api/login 404 (Not Found)
Thanks you helped me a lot :)! But i realized to the end of the Tutorial, that I just have to add 2 Lines to my existing App and the User stays logged in :D. Just localStorage.getItem and setItem! Great!
looking for the same stuff
Anyone is getting nothing in -> token?
yes, i an dealing with same problem. have you got any solution ?
1 - go to your index.php in the api folder
2 - check the signup function: function signup()
3 - delete or comment the following 'echo' lines:
echo $email_check.''.$email;
echo 'here';
4 - save the index.php
5 - refresh the app and try again