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
#1
Hey,

I am new at mysql and PHP and for some reason I just can't get the hang of it, because I already have got a website designed with a standard login form and I want user's to be able to also login to my website using there userspace login details and if they happen to navigate back to my website then it will say welcome (Username) at the top right hand corner. I home this is possible and if so how would i go about doing something like this.



Help is appreciated and thanks in advance.
  Reply
#2
Ok.  A few things on that....

As long as your other pages have the link to the init.php file on them, you have access to all userspice's stuff.
One issue is that if your pages have .html or .htm extensions, you won't be able to use php. Your pages will need to be renamed to .php

So. Assuming your pages have .php extensions and you have a link to the init.php file (the require once line that's at the top of every userspice page),
then you have access to all userspice's functionality.

You can do things like
if(isset($user) && $user->isLoggedIn()){
echoUser($user->data()->id);
}


echoUser is a built in userspice function and you can go to admin.php and in the tabs below decide how you want a username to look when you use the echoUser function.

As far as the existing login form goes, it might be easier if you paste that code on pastebin and share it here and also let me know where it is in relation to your userspice files.  Like what does your directory tree look like.  Btw, I'll be gone for the next 2 days, but we will get you fixed up.
  Reply
#3
Hey,


Thank you for getting back in touch, I am redesigning the website on html and after the site has been developed I will then change all pages to .php. I am planning for the user to be just navigated to the userspice login page, but when the navigate back to my website, then it will say something like Welcome (Username). When I am ready for the next step on liking both site together to work like this then I will reply on this post. If this would be okay




Regards
  Reply
#4
Absolutely. No problem.
  Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)