Need some help for my registeration thing

Hi !
To begin with, sorry for my bad english and my poor skills in PHP, i’m a real beginner.
So, i’ve tried this guide to create a registeration form in PHP : http://form.guide/php-form/php-registration-form.html
I am quite happy with the result, but some things are annoying :

1 - How can we remove the “Full Name” option without having bugs everywhere ? I tried removing them in the “fg_membersite” thing, but it’s still crashing. (If it’s too hard to explain or else i’ll try it alone, i guess it’s impossible to find everything to remove ?)

2 - They got a fonction who says the Full Name of the user logged on, so i wanted one who says the Username of the user

[php]Logged in as: <?= $fgmembersite->UserNickName()[/php]

So i looked up into the fg_membersite and i found this :
[php] function UserFullName()
{
return isset($_SESSION[‘name_of_user’])?$_SESSION[‘name_of_user’]:’’;
}[/php]

I don’t know what name_of_user refer to, but they speak about it one more time :

[php]

    $_SESSION['name_of_user']  = $row['name'];
    $_SESSION['email_of_user'] = $row['email'];
    return true;
}

[/php]

So, as “Name” and “Email” were both row in my MySQL Base, i tried to add
[php]
$_SESSION[‘username_of_user’] = $row[‘username’];[/php]

Then, i tried to add my function by myself and i tried this way, but it didn’t worked and the i couldn’t login in because i added the “Username_of_user” thing, surely because it was in the function “CheckLoginInDB”.

But they only speak about “name_of_user” here, so i’m kinda lost…
When i tried the thing btw, it just showed "Logged in as : ".

I apologize again for my very poor knowledge of PHP, i’m learning by using codes and not learning them, i just can’t learn by reading.

Thanks for the help ;D

Sorry, i don’t know how to edit ;D

So i’ve found how to put my username, by connecting at the database, selecting the row and echo-ing it.
My next question is : how to remove the “Full Name” thing ? :frowning:

Don’t waste your time with this code. The HTML and PHP is out of date and even when the code was in date, the implementation is filled with bad programming practices.

I recommend that you just learn basic HTML5 and PHP 5.6+ or 7+, then define what you want the form to have for form fields (username, email, and password would be the minimum needed for an email verified registration process) and then write your own form and form processing code.

Form processing code should -

  1. Detect that a post method form has been submitted.
  2. Validate the input data, storing any validation errors in a php array variable.
  3. If there are no validation errors (the php array variable is empty), use the submitted data.
  4. If there are validation errors, display them in the html document and re-display the form.
Sponsor our Newsletter | Privacy Policy | Terms of Service