The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Login, Register etc, using postman
#1
HI guys, I am new to php, I am coming from android. I see that this library it is pretty well done and it is exactly what I need for my app. The only problem that I have is that I really don't know how to login, or register, any action, without the HTML.
I am sure that I can use the login.php and register.php sending POST requests from the app, but I don't know how to get only the response. If you can help me elucidate this very big issue for me, I would be so happy and really promote this library for it is support too! Great job guys.
  Reply
#2
I've never developed on Android, but I can tell you how to do it over $_GET and then you'll have to work out how to do it over post so you're not sending passwords in the clear.

1. Create a login.php file in /usersc
2. Paste these contents in there...
http://pastebin.com/uTmcwxnW

3. Go to the gear in the upper right corner, click admin dashboard.

4. Click the 3rd panel at the top. Just opening the panel will add this file to the db properly.

5. Now you can login by passing $_GET or $_POST straight to login.php

6. The fastest way to test it is to logout and then send a get request like this...
http://yourdomain.com/usersc/login.php?u...d=password

You should automatically be logged back in and get redirected to the account.php page.

7. Then you just have to figure out how to send $_POST data from your app to the server. Note that Input::get will look for $_POST data and if it doesn't find it, it will look for $_GET data. So, the same method will work regardless of how you pass your data.

  Reply
#3
Thanks for the fast reply, appreciate it. It works, but in PostMan I still get some irrelevant code for me. What am I looking for is: http://yourdomain.com/usersc/login.php?u...d=password calling this and get a nice json response. I really don't know how, or if I ask something that is impossible for me atm. Thanks for your patience.
  Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)