Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    New Coder
    Join Date
    Sep 2002
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Really need help on using coldfusion... Lots of problems and is confused...

    i would like to know how to make a login and password on my web... so that when the user ID and the password are right... the user is able to access my menu on the web... and if the user ID and password are wrong... It'll then tell the user that the user ID and password are wrong and prompt the user to re-type...

    I would also like to know how to link from the login page to my menu page after the user had logged in and from my menu page's small links to view,edit, add and delete my ms access database by using a pop-up window(When clicked "...add..." icon, it'll pop up a mini-window)...

    My "adding11.cfm" file got errors, but i'm not sure how to solve it... The output for the date is wrong(not the date i typed)... Why is it like this?


    If possible, i would like to use coldfusion to solve the above problems...

    Thanks... Really need help...
    Attached Files Attached Files
    Last edited by helLO; 09-30-2002 at 04:53 AM.

  • #2
    mat
    mat is offline
    Regular Coder
    Join Date
    Jul 2002
    Posts
    199
    Thanks
    0
    Thanked 0 Times in 0 Posts
    so that when the user ID and the password are right... the user is able to access my menu on the web... and if the user ID and password are wrong... It'll then tell the user that the user ID and password are wrong and prompt the user to re-type...
    Well the basic concept is this:

    new person registers at your site > enters new infomation including user/pass into database.

    person goes to login page and enters user/pass > this login form could post that info to a .cfm page which selects 'user' and 'pass' from the database where they match what the user has typed in. If it doesn't find a match then obviously user and pass are wrong.
    you could use a simple CFIF statement to either re-direct them depending on wether they have logged in or failed..

    you also need to look at sessions, cookies and the the like which i am just staring to learn and play with now..

    these tuts may or may not be helpfull.

    http://hotwired.lycos.com/webmonkey/...tw=programming

    http://www.developerfusion.com/show/1811/1/

    http://www.hotscripts.com/Detailed/8273.html

    http://www.experts-exchange.com/Web/..._20079009.html

    http://www.cfvault.com/index.cfm/mod...utorial_Page/1



    I am just about to try a similar thing for an exercise, make a register/login system with search etc just available to members and such.

    how are you going with it?

    mat,
    Last edited by mat; 10-09-2002 at 09:22 PM.

  • #3
    Regular Coder
    Join Date
    Sep 2002
    Location
    Bugaha, NE
    Posts
    330
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I noticed on adding11.cfm the date field is 3 characters long, with a seperate month and year field. This page then submits to adding12.cfm. I see that you have output for date, but this is probably outputing only the 3 characters, or whatever is entered in the text box, right?

    You probably need to set date as a variable at the top of adding12.cfm to be comprised of month/date/year, in the order you want it.

    Just a thought--it's been a year since I looked at any cold fusion code and I don't even have cold fusion installed on my desktop machine anymore, so I wasn't able to really experiment on it. I'm an ASP guy now.

  • #4
    New Coder
    Join Date
    Sep 2002
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    reply

    Thanks...
    I'm still stuck at the adding part... and still trying...
    *sigh*

  • #5
    mat
    mat is offline
    Regular Coder
    Join Date
    Jul 2002
    Posts
    199
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You want the login cfm page to check if the user/pass is correct right? this means looking into the database and seeing if the user/pass entered in the input boxes matches what is in the database table.

    so a very simple example is attached

    what it does is on the login.html page > enter a username and a password - then this login .html page sends the user/pass to login.cfm which checks the database to see if there are any matches, if there are then it sends the user to the 'welcome.html' otherwise it sends them to 'error.html'

    login.cfm code:

    <cfquery name="checkLogin" datasource="your datasource name" username="your username" password="your pass"> // change the datasource, user + pass to yours.
    SELECT *
    FROM users
    WHERE user = '#inputUser#' AND pass = '#inputPass#'
    </cfquery>

    //^ it's selecting all data from the database table called 'users' and checking to see if there are any matches for what the user has typed in (inputUser, inputPass)

    // you'll have to create a simple database table called users with two columns 'user' & 'pass' put some names in both columns.


    <cfif checkLogin.recordCount is 1> // did it find any matches?
    <cflocation url = "welcome.html"> // if so go to welcome
    <cfelse>
    <cflocation url = "error.html"> // if not go to error
    </cfif>
    Attached Files Attached Files

  • #6
    New Coder
    Join Date
    Sep 2002
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    thanks...

    Thanks... what abt the add part... do u have any ideas on how to settle it and its errors?

    How would i prevent user to just type the URL of my pages... ( which mean that the user went into my contents without even going through the login page)

  • #7
    New Coder
    Join Date
    Sep 2002
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    thanks...

    Thanks... what abt the add part... do u have any ideas on how to settle it and its errors?

    How would i prevent user to just type the URL of my pages... ( which mean that the user went into my contents without even going through the login page)

  • #8
    mat
    mat is offline
    Regular Coder
    Join Date
    Jul 2002
    Posts
    199
    Thanks
    0
    Thanked 0 Times in 0 Posts
    your date output prob. as BigDadday pointed out.

    you have this :

    Date Joined(DD/MM/YYYY):<b> #date# </b>

    you sent it 3 variables(name="date" ...name="month" ..name="year") not just 'date'

    so if you want to output them then you need to specify the 3 variables names like so

    Date Joined(DD/MM/YYYY):<b> #date# #month# #year# </b>


    In terms of adding a new user to your database it's a matter of making a form which has input fields with variable names which you have already done

    and then making a cfm page to submit the form to with something like

    <CFQUERY NAME="addUser">

    INSERT INTO yourTableName Values '#inputName#', '#inputPhone#', '#other form input field variables go here..

    </CFQUERY>

  • #9
    New Coder
    Join Date
    Sep 2002
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    But...

    thanks... But I'm working with checkboxs... I'm thinking whether the stuffs i submitted(together with the checked checkboxs)is able to add into the database or not...
    Furthermore, the errors have been occurring at the same place which is here (after i edited the day, month, year to date)
    >>
    <cfquery name="insert" datasource="ALLCONTACTS">
    INSERT INTO students (ADMISSION, NAME, MOBILE, DATEJOINED, IT0201, IT0202, IT0203, IT0204, IT0205, IT0206, IT0207, IT0208, IT0209, IT0210, IT0211, IT0212, IT0213, IT0214, IT0215, IT0216, IT0217, IT0218, IT0225, IT0226, IT0250)
    VALUES ('#ADMISSION#', '#NAME#', '#MOBILE#', #DATE#, '#IT0201#', '#IT0202#', '#IT0203#', '#IT0204#', '#IT0205#', '#IT0206#', '#IT0207#', '#IT0208#', '#IT0209#', '#IT0210#', '#IT0211#', '#IT0212#', '#IT0213#', '#IT0214#', '#IT0215#', '#IT0216#', '#IT0217#', '#IT0218#', '#IT0225#', '#IT0226#', '#IT0250#')
    </cfquery>
    >>

    The errors that printed out is >>
    Error Diagnostic Information

    An error occurred while evaluating the expression:


    #ADMISSION#

    Error resolving parameter ADMISSION


    ColdFusion was unable to determine the value of the parameter. This problem is very likely due to the fact that either:

    You have misspelled the parameter name, or
    You have not specified a QUERY attribute for a CFOUTPUT, CFMAIL, or CFTABLE tag.

    >>

  • #10
    mat
    mat is offline
    Regular Coder
    Join Date
    Jul 2002
    Posts
    199
    Thanks
    0
    Thanked 0 Times in 0 Posts
    where is the page that these varibles are on ? ('#ADMISSION#', '#NAME#', '#MOBILE#', #DATE#, '#IT0201#', '#IT0202#', '#IT0203#', '#IT0204#', '#IT0205#', '#IT0206#', '#IT0207#', '#IT0208#', '#IT0209#', '#IT0210#', '#IT0211#', '#IT0212#', '#IT0213#', '#IT0214#', '#IT0215#', '#IT0216#', '#IT0217#', '#IT)....


    it's saying that it doesn't have that variable 'admission' so i'm thinking did you actually pass/post the variable to this cfm page?

  • #11
    Senior Coder
    Join Date
    Jun 2002
    Location
    41 8' 52" N -95 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't know cold fusion, but from what I've seen it's similar/simpler than ASP (although it has a lot of propietary code)... try writing out the INSERT statement to your page that receives the variable.

    Or, just try writing the actual variable that is giving you problems to the page, to see if it is even being passed to the page.

    Then you have a starting point in debugging.

    P.S. As BigDaddy has experience in ColdFusion (and a LOT of experience in debugging ), I'd guess that he may be correct in that the variable is not initialized on the receiving page, therefore it isn't getting a value.
    Last edited by whammy; 10-15-2002 at 02:22 AM.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #12
    New Coder
    Join Date
    Sep 2002
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Reply

    <cfquery name="insert" datasource="ALLCONTACTS">
    INSERT INTO students (ADMISSION, NAME, MOBILE, DATEJOINED, IT0201, IT0202, IT0203, IT0204, IT0205, IT0206, IT0207, IT0208, IT0209, IT0210, IT0211, IT0212, IT0213, IT0214, IT0215, IT0216, IT0217, IT0218, IT0225, IT0226, IT0250)
    VALUES ('#ADMISSION#', '#NAME#', '#MOBILE#', #DATE#, '#IT0201#', '#IT0202#', '#IT0203#', '#IT0204#', '#IT0205#', '#IT0206#', '#IT0207#', '#IT0208#', '#IT0209#', '#IT0210#', '#IT0211#', '#IT0212#', '#IT0213#', '#IT0214#', '#IT0215#', '#IT0216#', '#IT0217#', '#IT0218#', '#IT0225#', '#IT0226#', '#IT0250#')
    </cfquery>
    I placed these codes in the recieving and print out page... am i right by doing that?

  • #13
    Regular Coder
    Join Date
    Sep 2002
    Location
    Bugaha, NE
    Posts
    330
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Cold Fusion handles the sql a bit different. In ASP, we have to put the SQL statement in a variable. Whammy's suggestion to print out the SQL statment doesn't quite work the same as it would if it was ASP--if I remember correctly. I would have to say check to make sure that the variable

    Admission is not recognized. Cold Fusion chokes on that, because it doesn't have a value for it.

    All I can suggest is at the top of the page, place a <cfoutput>, giving you the value of "Admission". Then run the page, submit it, and when the new page loads, check the value of it to see if it is being given a value.

  • #14
    New Coder
    Join Date
    Sep 2002
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thank you very much... Its worked...

    But i'm having problem with editing... I can't make it working with checkboxes... there is no response in the checkboxes in the database... I tried changing the data types of the module codes from a checkbox form to text and vice versa... But it doesn't seem to work...
    I attached the files... hope that all ppl who is wiling to help, can have a look and help me...
    Thanks...
    Last edited by helLO; 10-24-2002 at 05:07 AM.

  • #15
    Regular Coder
    Join Date
    Sep 2002
    Location
    Bugaha, NE
    Posts
    330
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't have a lot of experience using Access. Most of my database experience is in Oracle or SQL Server, but I noticed your checkbox field names all start with the word "codes:".
    I don't know if this is normal for Access or not, but I would guess your insert statement needs to have that in the field names.

    I would actually suggest you modify your table field names to remove "codes:" from the beginning. Or, you need to modify your insert statement to include "CODES:" in front of each of the field names.

    Example:

    <cfquery name="insert" datasource="ALLCONTACTS">
    INSERT INTO students (ADMISSION, NAME, MOBILE, DATEJOINED, CODES:IT0201, CODES:IT0202, CODES:IT0203, CODES:IT0204, CODES:IT0205, CODES:IT0206, CODES:IT0207, CODES:IT0208, CODES:IT0209, CODES:IT0210, CODES:IT0211, CODES:IT0212, CODES:IT0213, CODES:IT0214, CODES:IT0215, CODES:IT0216, CODES:IT0217, CODES:IT0218, CODES:IT0225, CODES:IT0226, CODES:IT0250)
    VALUES ('#ADMISSION#', '#NAME#', '#MOBILE#', #DATE#, '#IT0201#', '#IT0202#', '#IT0203#', '#IT0204#', '#IT0205#', '#IT0206#', '#IT0207#', '#IT0208#', '#IT0209#', '#IT0210#', '#IT0211#', '#IT0212#', '#IT0213#', '#IT0214#', '#IT0215#', '#IT0216#', '#IT0217#', '#IT0218#', '#IT0225#', '#IT0226#', '#IT0250#')
    </cfquery>


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •