You need to sign in to do that
Don't have an account?
Chinmoy Debnath
After Logging in Getting Username through URL
Im creating a registration system, I want to get the username of user after logging in, through URL so that I can do SOQL queries.
Eg: Anyone named rick logged in
I want the next page to be "Hi Rick"
for this i need the username to get the details through SOQL
Eg: Anyone named rick logged in
I want the next page to be "Hi Rick"
for this i need the username to get the details through SOQL
and other fields are Email__c and Password__c
my login page code is:
<apex:page showHeader="false" sidebar="false" controller="login">
<h1>Login</h1>
<apex:form >
Email<apex:inputText value="{!email}"/>
Password<apex:inputSecret value="{!password}"/>
<apex:commandButton value="Submit" action="{!login}"/>
</apex:form>
</apex:page>
public class login
{
public String email{set;get;}
public String password{set;get;}
public Registration__c fet=null;
pageReference obj;
public pageReference login(){
try{
fet=[SELECT name from Registration__c where Email__c=:email and Password__c=:password];
}
catch(Exception e){}
if(fet!=null){
obj=new pageReference('https://ap2.salesforce.com/apex/Index');
obj.setRedirect(true);
}
else{
obj=new pageReference('/apex/Login?success=user not valid');
obj.setRedirect(true);
}
return obj;
}
}
****now i want to get the username and his details in the index page. So, HOW???******