PHP Tutorials: Register & Login: User registration (Part 2)

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
79,466
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Feb 20, 2009

Part of the 'Register & Login' Project from phpacademy. This tutorials walks you through registering a user to allow them to log in to your site.

Official website
http://phpacademy.org

Support Forum
http://phpacademy.org/forum

Follow us on Twitter!
http://twitter.com/phpacademy

  • likes, 6 dislikes

Link to this comment:

Share to:

Top Comments

  • Notice: Undefined index: submit in C:\xampp\htdocs\SiteB\Register­.php on line 2

    Notice: Undefined index: fullname in C:\xampp\htdocs\SiteB\Register­.php on line 4

    Notice: Undefined index: username in C:\xampp\htdocs\SiteB\Register­.php on line 5

    Notice: Undefined index: password in C:\xampp\htdocs\SiteB\Register­.php on line 6

    Notice: Undefined index: repeatpassword in C:\xampp\htdocs\SiteB\Register­.php on line 7

  • Guys if you get a undefined index error, just add a @ at the begining of all $_POST in your register.php. For example:

    $submit = @$_POST['submit'];

    //form data

    $fullname = @$_POST['fullname'];

    $username = @$_POST['username'];

    $password = @$_POST['password'];

    $repeatpassword = @$_POST['repeatpassword'];

    if ($submit)

    it worked for me

see all

All Comments (208)

Sign In or Sign Up now to post a comment!
  • @tonytrfd write on top error_reporting(0);

  • Guys if you get a undefined index error, just use a ternary operator, it doesn't hide the error:

    $submit = isset($_post['submit']) ? $_post['submit'] : '';

    //form data

    $fullname = isset($_post['fullname']) ? $_post['fullname'] : '';

    $username = isset($_post['username']) ? $_post['username'] : '';

    $password = isset($_post['password']) ? $_post['password'] : '';

    $repeatpassword = isset($_post['repeatpassword']­) ? $_post['repeatpassword'] : '';

  • @XxRedDude Putting @ in front of the posts won't stop the actual error it will just hide the error message.

  • md5decrypt(dot)org

  • @tonytrfd i got the same error too but once i set the items they went away...i suppose it was b/c the variabled werent being used

  • @MrYoranimo Thank you again.

  • @kobi1974 If you have trouble with errors in PHP, you can add an at sign before an called function, or like in the example, before a variable. It will suppress the warnings that normally come up when there is one.

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more