Jump to content

[SOLVED] Values wrong in database


JeanieTallis

Recommended Posts

we've got our error, its not getting the values from location. I'm guessing where its like $sublocation, its not recognising its meant to be location. So i need to define location to $sub, would that be right?

 

You need to keep backtracking to where it gets passed to and find out where its losing its value.

Link to comment
Share on other sites

Well, I realised why I wernt getting an error why I never typed it in, in one of the php codes in the form itself on the register.php, well both of them for the same field had 'value' one was suppoes to be an error, I will see if I receive an error now, and then recieve a value, as i think, it's selecting the second value that was there, which isn't connected to the field, its for the error.

Link to comment
Share on other sites

You need to keep backtracking to where it gets passed to and find out where its losing its value.

 

Have any idea how I'd get it to get the value?

 

Start with your form.  You pass it to process.php (which I haven't seen) check in there, keep following it around and echoing it out until you see where it either gets mixed up with another variable or somehow gets converted into a timestamp.

Link to comment
Share on other sites

I don't know if this will be any help, I've set it so that if you don't select a location, it errors out "Location not selected" After messing about I finally got it to give an error!

 

Though, it does see the value, (session.php see's the value) because, if I select a location, it does submit the form, however, it does go to 'process.php' with the die, you told me to add in, and then that dont get the location.

 

I'm assuming, its process.php, thats not getting the value.

Link to comment
Share on other sites

Had no success, ive changed userinfo.php and useredit.php and process.php so I can edit the location (if someone were to move countries etc)

 

This is the code for registration in the process.php

<?php    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'], $_POST['location']);
      
      /* 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);
      }
   } ?> 

Link to comment
Share on other sites

I just don't get it, I wish someone would help me.

It gets the value $sublocation for the error to come up, but doesn't get it to send to database. Yet both is done on same page.

 

**EDIT**

If I removed the die, it says registration failed, so maybe, if I got it to succeed, it'll show the value.

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.