Maq Posted April 3, 2009 Share Posted April 3, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/152392-solved-values-wrong-in-database/page/2/#findComment-800587 Share on other sites More sharing options...
JeanieTallis Posted April 3, 2009 Author Share Posted April 3, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/152392-solved-values-wrong-in-database/page/2/#findComment-800600 Share on other sites More sharing options...
JeanieTallis Posted April 3, 2009 Author Share Posted April 3, 2009 Still not recieving a value :/ so what I thought was wrong about the value. Quote Link to comment https://forums.phpfreaks.com/topic/152392-solved-values-wrong-in-database/page/2/#findComment-800606 Share on other sites More sharing options...
JeanieTallis Posted April 3, 2009 Author Share Posted April 3, 2009 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? Quote Link to comment https://forums.phpfreaks.com/topic/152392-solved-values-wrong-in-database/page/2/#findComment-800616 Share on other sites More sharing options...
Maq Posted April 3, 2009 Share Posted April 3, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/152392-solved-values-wrong-in-database/page/2/#findComment-800617 Share on other sites More sharing options...
JeanieTallis Posted April 3, 2009 Author Share Posted April 3, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/152392-solved-values-wrong-in-database/page/2/#findComment-800623 Share on other sites More sharing options...
JeanieTallis Posted April 3, 2009 Author Share Posted April 3, 2009 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); } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/152392-solved-values-wrong-in-database/page/2/#findComment-800640 Share on other sites More sharing options...
JeanieTallis Posted April 3, 2009 Author Share Posted April 3, 2009 Just still can't retreive the value. Quote Link to comment https://forums.phpfreaks.com/topic/152392-solved-values-wrong-in-database/page/2/#findComment-800651 Share on other sites More sharing options...
JeanieTallis Posted April 3, 2009 Author Share Posted April 3, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/152392-solved-values-wrong-in-database/page/2/#findComment-800665 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.