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
Troubles when making a register form
#11
I copied the code of header and nav in my header, just adapted everything...
  Reply
#12
The token should be generated in the form itself and read in the $_POST section. The class itself is auto-instantiated in the init.

Ok. So let's take a step back. There's a "proper" way to do this that will allow us to help you and make sure our updates don't break your system.

Step 1.
Don't modify anything in the users folder. Leave that alone. We've worked super hard to make sure it's not necessary to change anything there. Maybe the login links in the navigation or something like that, but no "real" editing. To be honest, I think if I wanted ABSOLUTE compatibility, I wouldn't even change the login links. I would create a login.php in usersc and put
<?php require_once '../users/init.php';
Redirect::to('../login.php');

This lets you leave EVERYTHING alone and won't have compatibility options.

Step 2.
You're absolutely fine putting your login file in the root.
In fact, if I take your paste here
http://pasted.co/fd5abeea
and create a login.php file in the root, it works fine for me.

Step 3.
If that paste doesn't work for you... go back and revert any core userspice files you changed because you probably broke something.
Note that my paste from you didn't have your header and footer stuff. See the screenshot...
http://puu.sh/xvC01/7517444e95.png

So, if you revert your files and are still having a problem, then your problem is in the header/footer files that you created (which weren't loaded on my system). Try commenting those out until you can login and that will point you to where your problem is.

Step 4.
Includes. When you're doing include/require once, we have some magic urls that are available to you.
A require once should look like this
Code:
<?php require_once $abs_us_root.$us_url_root.'users/includes/header.php'; ?>
note that there is no / between the us_url_root and users. You can point that wherever you want. It doesn't have to go to the users file, but that formatting will "magically" grab the beginning part of your path so it will always be right.

These are little nit picks, but if you start doing things this way, your life will be INCREDIBLY easier down the road when you try to upgrade and when you want help in the forums.

And as always, I tell newbies with userspice to check out this video on dealing with the database...
https://www.youtube.com/watch?v=rb0kD5tCENM
  Reply
#13
I tried <?php require_once $abs_us_root.$us_url_root.'includes/head.php'; ?> to include a part in users/join.php but the page is just blank...
  Reply
#14
Are you including
Code:
head.php
or
Code:
header.php
? The correct page should be
Code:
header.php
. If that's the one you are using and are still getting a blank page it's a different problem that we'll help you track down.
  Reply
#15
I'm trying to include a page called head.php, it's all the part before <!DOCTYPE html>. It works well on my index page, but when I put it on the users/join.php it doesn't work.
What I want to do is to make all my pages starting like this: http://pasted.co/4dd2ff6c. It works well on the index page, but not on other pages.
Page head.php: http://pasted.co/4e404c3d
Page header.php: http://pasted.co/fec196e7
  Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)