Jump to content

Jpmaster77's Login Script Trouble


02lyons

Recommended Posts

Hi, I'm new to php and am building a website that requires login. Not being a veteran at php, I decided to use a login script by Jpmaster77 at evolt.com (here) but have run into difficulties. I have managed to fix some errors when integrating it into my site, but one crucial problem has stumped me for the last few days. It happens when a script called 'process.php' is called upon when someone registers, logs in or when any other form is submitted. Currently when the user clicks submit, the web browser is directed to process.php and all that happens is a blank page. When I check View Source, there is nothing in the window, no error messages, nothing. However, when I check phpMyAdmin, the user information has been submitted into the database.

 

Here is the part of the code that deals with registering...

 

/**
    * procRegister - Processes the user submitted registration form,
    * if errors are found, the user is redirected to correct the
    * information, if not, the user is effectively registered with
    * the system and an email is (optionally) sent to the newly
    * created user.
    */
   function procRegister(){
      global $session, $form;
      /* Convert username to all lowercase (by option) */
      if(ALL_LOWERCASE){
         $_POST['user'] = strtolower($_POST['user']);
      }
      /* Registration attempt */
      $retval = $session->register($_POST['user'], $_POST['pass'], $_POST['email']);
      
      /* Registration Successful */
      if($retval == 0){
         $_SESSION['reguname'] = $_POST['user'];
         $_SESSION['regsuccess'] = true;
         header("Location: ".$session->referrer);
      }
      /* Error found with form */
      else if($retval == 1){
         $_SESSION['value_array'] = $_POST;
         $_SESSION['error_array'] = $form->getErrorArray();
         header("Location: ".$session->referrer);
      }
      /* Registration attempt failed */
      else if($retval == 2){
         $_SESSION['reguname'] = $_POST['user'];
         $_SESSION['regsuccess'] = false;
         header("Location: ".$session->referrer);
      }
   }

 

I have not changed any of this code, and the full script with the other scripts can been seen in the above link. My web host is using php 4.4.7, if that helps.

 

Please help! I need this to work soon!

-02lyons

Link to comment
https://forums.phpfreaks.com/topic/67551-jpmaster77s-login-script-trouble/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.