function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Pathan S 4Pathan S 4 

I created one login page..I want to display user details in one another vf page after his registration(username password).Plz Post

I created one login page..I want to display user details in one another vf page after his registration(username password).Plz telme how to do. After Registration ur pasword and username are this...like i want to show.
NagendraNagendra (Salesforce Developers) 
Hi Pathan,

May I suggest you please give a try by using the sample code below which should give you the needed direction.

Apex Controller:
Public class gmController{

    public NKBIT__Gmail__c reg { set; get;}
    public List<NKBIT__Gmail__c> gmailuser{get; set;}
    public Boolean Match{get; set;}
    public Boolean NoMatch{get; set;}
   
    Public gmController(){
        reg = new NKBIT__Gmail__c();
    }
   
   Public PageReference timecardsignin(){
       gmailuser =new List<NKBIT__Gmail__c>();
       Match=false;
       NoMatch=false;
       
       gmailuser=[select NKBIT__User_Name__c, NKBIT__Password__c from NKBIT__Gmail__c where NKBIT__User_Name__c =:reg.NKBIT__User_Name__c AND NKBIT__Password__c =:reg.NKBIT__Password__c];
       
       if(gmailuser.size()>0)
       {
           Match=true;
       }
       else
       {
           NoMatch=true;
       }
    
        PageReference pageRef = new PageReference('/apex/timecardpage');
        pageRef.setRedirect(true);
        return pageRef;
   }
    
    public PageReference doCancel()
    {
        PageReference pageRef = new PageReference('/apex/timecardpage');
        pageRef.setRedirect(true);
        return pageRef;
    }

  }
Visual Force Page:
<apex:page Controller="gmController">


     <apex:form >
     <apex:pageMessages />
           <apex:pageBlock >
           <apex:pageBlockSection columns="1">
                             
                   <apex:pageBlockSectionItem >
                         <apex:outputLabel value="User Name" for="resource"/>
                         <apex:inputField value="{!reg.User_Name__c}" id="resource"/>
                     </apex:pageBlockSectionItem>

                
                   <apex:pageBlockSectionItem >
                         <apex:outputLabel value="Passcode" for="passcode" />
                         <apex:inputSecret value="{!reg.Password__c}" id="passcode"/>
                     </apex:pageBlockSectionItem>
                
               <apex:outputPanel id="notmatch">
                   <apex:pageBlockSectionItem rendered="{!NoMatch}">Invalid Resource or Passcode</apex:pageBlockSectionItem>
               </apex:outputPanel>
             
              
           </apex:pageBlockSection>
           <apex:pageBlockButtons location="bottom">
                   <apex:commandButton value="Login" action="{!timecardsignin}" reRender="notmatch"/>
                   <apex:commandButton action="{!doCancel}" value="Cancel"/>
              </apex:pageBlockButtons>
                     
           </apex:pageBlock>
     </apex:form>
</apex:page>
Please check with below link for a similar kind of issue. Hope this helps.

Please mark this as solved if it's resolved so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.

Thanks,
Nagendra