From login page... Welcome #username#.. problems..

Posted on 2006-03-22
Last Modified: 2013-12-24
I wonder of any of you can help...

I have 3 files... login.cfm, login5.cfm, and checklogin cfm..

The login.cfm is a screen where you put your username and password, press ok and it goes to login5.cfm>>

<cfquery name="check" datasource="jasvasquez-access">
  select * from Users where user_ID = '#form.username#' and password = '#form.password#'

<cfif check.recordcount is "1">
  <cfoutput query="check">
    <cfset session.loggedin = "true">
  <script language="JavaScript">
     alert( 'You sucessfully logged in ... Please press ok!.');
  <script language="JavaScript">
    alert( 'Please check your username and password, then try again.');

Then you press ok and it directs you to checklogin.cfm>>

<CFIF Session.LoggedIn NEQ "True">
  <CFLOCATION URL="/students/jasocke2/checklogin1.cfm">
<body bgcolor="#FFFFFF" text="#000000">
<div align="center"></div>
<div align="center">
  <p align="left"><a href="allgigs.cfm">View all Gigs</a></p>
  <p align="left"><a href="addgig.cfm">Add Gig</a></p>
  <p align="left"><a href="update1.cfm">Update Gig</a></p>
  <p align="left"><a href="newsupdate.cfm">Change News</a></p>
    <p align="left"><a href="delete.cfm">Delete a played Gig</a></p>
  <div align="left">
    <p><i>.</i> </p>
<div align="left">


what I want is pretty simple (I think) although I've tried alsorts and it wont work!!
I want it so when you login it says Welcome (and then the username that you put in on the first screen)...

and ideas?
All I have been getting is username not defied in form!
Thanks in advance...
Question by:jasocke2
    LVL 24

    Expert Comment

    OK - Try putting (on your first form action page - where you have the query where user_ID = '#form.username#' and password = '#form.password#')
    <cfcookie name="Username" value="#form.Username#">
    Then where ever you want put
    <cfif isDefined("cookie.Username")>
    Welcome #cookie.Username#

    Author Comment

    it's coming up...

    Welcome #cookie.Username# ...

    where abouts do I put it in the text?

    (sorry for sounding stupid!!)
    LVL 24

    Accepted Solution

    I guess I don't know what you mean exactly
    Are you saying this is exactly how you see it "Welcome #cookie.Username# ..."
    If so - you need <cfoutput> tags around it "Welcome <cfoutput>#cookie.Username#</cfoutput> ..."
    Let me know if thats not it ...

    Author Comment

    Your a star!
    Works a treat!

    Featured Post

    Network it in WD Red

    There's an industry-leading WD Red drive for every compatible NAS system to help fulfill your data storage needs. With drives up to 8TB, WD Red offers a wide array of solutions for customers looking to build the biggest, best-performing NAS storage solution.  

    Join & Write a Comment

    Suggested Solutions

    One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
    When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now