Hi, I was wondering if anyone can help me with this quickly.
I created a log in button where our customers can jsut click the button and it will log them in this members page.
The code looks like this:
<FORM NAME="CFForm_1" ACTION=" METHOD=POST >
<INPUT TYPE="hidden" NAME="username" value="dan"><br>
<INPUT TYPE="hidden" NAME="password" value="dynojet"><br>
<input type="SUBMIT" value="Login" name="login">
</FORM>
As you can see, the username= dan .. and password= dynojet
What I want now, is inserting this in the URL instead of creating a button with hidden values.
Example would be something that looks like this:
How will the URL look like if I want to do it this way ? (it will be passed to a page called login_action) that looks like this:
<cfif NOT IsDefined ('form.username')>
<cflocation url="login_button.cfm" addtoken="No">
</cfif>
<cfquery name="gilwayb" datasource="AuthorizedUsers">
SELECT *
FROM Users
WHERE USERNAME = '#FORM.username#'
AND PASSWORD = '#FORM.password#'
</cfquery>
<CFSET Session.LoggedIn = "1">
<CFSET Session.Fname = "#gilwayb.FName#">
<CFIF gilwayb.RecordCount IS 0>
<cflocation url="noentry.cfm" addtoken="No">
<CFSET StructClear(Session)>
<cfelse>
<CFSET Session.LoggedIn = "1">
<cflocation url="welcome.cfm" addtoken="No">
</cfif>
thanks
-jon
I created a log in button where our customers can jsut click the button and it will log them in this members page.
The code looks like this:
<FORM NAME="CFForm_1" ACTION=" METHOD=POST >
<INPUT TYPE="hidden" NAME="username" value="dan"><br>
<INPUT TYPE="hidden" NAME="password" value="dynojet"><br>
<input type="SUBMIT" value="Login" name="login">
</FORM>
As you can see, the username= dan .. and password= dynojet
What I want now, is inserting this in the URL instead of creating a button with hidden values.
Example would be something that looks like this:
How will the URL look like if I want to do it this way ? (it will be passed to a page called login_action) that looks like this:
<cfif NOT IsDefined ('form.username')>
<cflocation url="login_button.cfm" addtoken="No">
</cfif>
<cfquery name="gilwayb" datasource="AuthorizedUsers">
SELECT *
FROM Users
WHERE USERNAME = '#FORM.username#'
AND PASSWORD = '#FORM.password#'
</cfquery>
<CFSET Session.LoggedIn = "1">
<CFSET Session.Fname = "#gilwayb.FName#">
<CFIF gilwayb.RecordCount IS 0>
<cflocation url="noentry.cfm" addtoken="No">
<CFSET StructClear(Session)>
<cfelse>
<CFSET Session.LoggedIn = "1">
<cflocation url="welcome.cfm" addtoken="No">
</cfif>
thanks
-jon