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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.