I have a php script and there is a class that is in an include. The original code had a username and password hard-coded, and when I try to switch it to the username and password that was passed in from a form on the page before, I get the following error...

Fatal error: Class 'Source' not found in C:\Inetpub\wwwroot...\class_ua_mvrz.php on line 92

I saw a post for the same error, but that was a missing semicolon and that is not the case here.

	function setLoginInputs() {
		// Get form sourceLogin object
// WORKS:
		$this->formInputs['txtPassword']['value'] = "username";
		$this->formInputs['txtUserName']['value'] = "myemail@address.com";

// WISH IT WORKED:
		$this->formInputs['txtPassword']['value'] = $_POST['ROUsername'];
		$this->formInputs['txtUserName']['value'] = $_POST['ROPassword'];


	return true;
}

    The error does not make sense with respect to the code snippet that you provided. You might want to show more code, preferable the smallest and simplest example that can be run to demonstrate the error.

      sorry I had to remove this code because it is proprietary. Feel free to delete this thread if that is going to be a problem.

        First, please use the "

        " [url=http://phpbuilder.com/board/misc.php?do=bbcode]vbCode tags[/url] around your code samples.
        
        Second, the error message says the problem is in file "class_ua_mvrz.php", but the code sample you have provided starts by requiring that file, suggesting to me that the code you have shown us is not, in fact, the class_ua_mvrz.php file.

          Nog,
          The reason the code above has an include to the code where the error is, is because the code I am showing you above, is the cause of the error in the other place. I contacted the original code author and the error is some debugging class which I do not have which is why that is messed up...

          So the problem I think is going to be that I am not clear on the scope of the variables. Would I be correct in assuming that the $_POST variables are available globally?

          The original author said that if the value of the variable is identical to what was hard-coded, that there is no reason that it would error out. So I am wondering if maybe that $_POST variable is not available within the class that is trying to use it. Can you comment on that please? THANKS

          I have posted the entire project on my personal website, and if you private message me or email me I will give you the URL, but this is for my job so unfortunately I cannot post it right here. My email is rmonahan at ritman dot com.

            This was a newbie mistake and the problem is crystal clear now. I had the username and password mixed up. I knew I needed to post this in the newbie section!

              Write a Reply...