The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (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
#1
Hi,

I'm having troubles when I want to adapt your code for my website. Everytime I get either 'Token doesn't match' or several errors: Notice: Undefined index: username in /Applications/MAMP/htdocs/igloo-new/users/classes/Validate.php on line 35

Notice: Undefined index: username in path/users/classes/Validate.php on line 35

Notice: Undefined index: password in path/users/classes/Validate.php on line 35

Notice: Undefined index: password in path/users/classes/Validate.php on line 35

Notice: Array to string conversion path/login.php on line 100

Notice: Array to string conversion in path/login.php on line 100

This is my code:
<pre>
Code:
<form action="login.php" class="login-landlord" name="login-landlord" method="post">
    <ul>
        <li class="titre-login">Login as a landlord</li>
        <li><input type="text" placeholder="Email"></li>
        <li><input type="password" placeholder="Password"></li>
        <li><input name="submit" type="submit" value="Login" class="btn" style="color:white"></li>
        <li><input type="checkbox" name="remember" id="remember" > Remember Me</li>
        <input type="hidden" name="csrf" value="<?=Token::generate(); ?>">
    </ul>
</form>
</pre>



I just copied the rest.

Thanks for your answers!
  Reply
#2
Can you paste your whole file at a site such as hastebin, pastebin or pasted.co?

Thank you.
  Reply
#3
Sure, this is the link : http://pasted.co/16ba787d
  Reply
#4
We need the entire login.php file pasted. I can't see in this where you're doing any validation.

I do notice that you did not give your email and password form fields name attributes. They should be name="username" and name="password" if you want to be able to "grab" them when you're processing the form.
  Reply
#5
http://pasted.co/fd5abeea.

I corrected what you told me, now it just reloads the page
  Reply
#6
Is this file in usersc/login.php ?

a. It should be so we don't accidentally overwrite your changes with an update.
b. if so, the require once should be ../users/init.php

Making that change, it works for me on userspice 4.2.9
  Reply
#7
No the file is in my root. But I changed the links in init to update them. I also tried with an account not registered, and when it should tell me that this account doesn't exist it just reloads
  Reply
#8
@mudmin - where is the token handled/read from? Init? Header? Nav?

You can see he isn't calling the header and nav of US in his script - only his own website - could this be the issue?
  Reply
#9
I copied everything from the header and nav like it was
  Reply
#10
Why is it called so far down then? Normally you call the header and nav after the init... You also have more header stuff in this file. It might be best to copy the form and just have it post to /users/login.php
  Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)