User Profile Update Page

Ask a Question related to Macromedia Dynamic HTML, Design and Development.

  1. #1

    Default User Profile Update Page

    Can any of you pros give me a hand out there?

    I?m fairly new to Dreamweaver MX 2004 but have been using it very heavily for
    the last couple of months.

    I?m trying to accomplish a ?User Profile Update page?. I?d like the logged in
    User of the site to be able to update his/her records (FirstName, LastName,
    Address, City, State, PostalCode,etc.) when a ?View / Edit? Profile button is
    selected. Is this possible? Do I need to tie this information to a Session
    Variable? If so, can anyone show me an example code?

    Below is how my Dynamic page is setup:

    <b>Application Server:</b> ColdFusion
    <b>Database:</b> Access 2003, no password required to access database.

    Any information in the right direction is most appreciated.


    Hellyhansenv Guest

  2. Similar Questions and Discussions

    1. creating a user profile for the aspnet user
      Hi, I have an asp.net web app that needs to invoke MS word. I have given the ASPNET user the relevant privileges and eveything works fine....
    2. Move user profile
      I will change the hp ux server to linux server , what is the best way to move the user profile ( /etc/passwd , /etc/shadow etc ) ? thx.
    3. Domain user can't modify user profile
      Hello! Please help me. I have got a SAMBA, when an Windows XP user login, when it get an error message : Roaming Profile ... bla bla bla It...
    4. User profile info not being saved
      I have 2 users on XP pro. Each time that the computer boots up, it starts in 640x480. Each user can change the resolutions, but on restart it...
    5. Corrupt user profile?
      My logon window in XP Home has started to show this message: "the system could not log you on. Make sure your username and domain are correct,...
  3. #2

    Default Re: User Profile Update Page

    1. I'm able to create a Recordset with a Filter:
    Username = Session Variable "Username". I run the test via the recordset
    window in DW and works properly for extracting the proper information.

    What is the next step?

    Hellyhansenv Guest

  4. #3

    Default Re: User Profile Update Page

    Did you use the Dreamweaver login/authentication stuff? If so, there will be a
    session variable called MM_Username that you can use to identify your user.

    Then you have to build your update page with whatever queries/information you
    want to be displayed, plus a form and associated fields for the bits you want
    them to be able to change.

    If you use the build in login/auth/insert/update server behaviours, it's a lot
    easier :-)

    MrBonk Guest

  5. #4

    Default Re: User Profile Update Page

    MrBonk,

    Thanks for your help, however I'm a little confused about the exact server
    Behavior process. If you or anyone can help stir me in the right direction I
    would greatly appreciate it.

    I understand the process of setting up different server behaviors and actually
    have Login/Auth on the majority of my pages.

    My trouble lies in getting this page to work properly. Currently, I?ve setup
    this page with the following:

    1. RecordSet: I?m confused on the Filter part??.. Should my goal page
    reference to a Session Variable or a URL Parameter?

    2. Form: Form is created and several Form objects (textboxes) have been
    added. Do I need any hidden objects or will the Session Variable do the trick?

    3.Binding: Should anything be binded?

    4. Server Behavior: I have Logout and Restricted Access applied to the page.
    Do I add both the Insert Record behavior and Update Record Behavior?

    For your viewing I've attached the code currently being used.

    Thanks Again!
    Brandon


    <cfif IsDefined("URL.MM_logout") AND URL.MM_logout EQ "1">
    <cflock scope="Session" type="Exclusive" timeout="30" throwontimeout="no">
    <cfset Session.MM_Username="">
    <cfset Session.MM_UserAuthorization="">
    </cflock>
    <cfset MM_logoutRedirectPage="../Home.cfm">
    <cfif MM_logoutRedirectPage EQ "">
    <cfset MM_logoutRedirectPage=CGI.SCRIPT_NAME>
    </cfif>
    <cfset
    MM_logoutQuery=ListDeleteAt(CGI.QUERY_STRING,ListC ontainsNoCase(CGI.QUERY_STRING
    ,"MM_logout=","&"),"&")>
    <cfif MM_logoutQuery NEQ "">
    <cfif Find("?",MM_logoutRedirectPage) EQ 0>
    <cfset MM_logoutRedirectPage=MM_logoutRedirectPage & "?" &
    MM_logoutQuery>
    <cfelse>
    <cfset MM_logoutRedirectPage=MM_logoutRedirectPage & "&" &
    MM_logoutQuery>
    </cfif>
    </cfif>
    <cflocation url="#MM_logoutRedirectPage#" addtoken="no">
    </cfif>
    <cfset CurrentPage=GetFileFromPath(GetTemplatePath())>
    <cfif IsDefined("FORM.MM_UpdateRecord") AND FORM.MM_UpdateRecord EQ "Profile">
    <cfquery datasource="gaswear">
    UPDATE tblCustomer SET StationName=
    <cfif IsDefined("FORM.StationName") AND #FORM.StationName# NEQ "">
    '#FORM.StationName#'
    <cfelse>
    NULL
    </cfif>
    , StoreNumber=
    <cfif IsDefined("FORM.Storenumber") AND #FORM.Storenumber# NEQ "">
    '#FORM.Storenumber#'
    <cfelse>
    NULL
    </cfif>
    , FirstName=
    <cfif IsDefined("FORM.Firstname") AND #FORM.Firstname# NEQ "">
    '#FORM.Firstname#'
    <cfelse>
    NULL
    </cfif>
    , LastName=
    <cfif IsDefined("FORM.LastName") AND #FORM.LastName# NEQ "">
    '#FORM.LastName#'
    <cfelse>
    NULL
    </cfif>
    , DOB=
    <cfif IsDefined("FORM.DOB") AND #FORM.DOB# NEQ "">
    '#FORM.DOB#'
    <cfelse>
    NULL
    </cfif>
    , BillingAddress=
    <cfif IsDefined("FORM.BillingAddress") AND #FORM.BillingAddress# NEQ "">
    '#FORM.BillingAddress#'
    <cfelse>
    NULL
    </cfif>
    , City=
    <cfif IsDefined("FORM.City") AND #FORM.City# NEQ "">
    '#FORM.City#'
    <cfelse>
    NULL
    </cfif>
    , PostalCode=
    <cfif IsDefined("FORM.PostalCode") AND #FORM.PostalCode# NEQ "">
    #FORM.PostalCode#
    <cfelse>
    NULL
    </cfif>
    , PhoneNumber=
    <cfif IsDefined("FORM.PhoneNumber") AND #FORM.PhoneNumber# NEQ "">
    '#FORM.PhoneNumber#'
    <cfelse>
    NULL
    </cfif>
    , FaxNumber=
    <cfif IsDefined("FORM.FaxNumber") AND #FORM.FaxNumber# NEQ "">
    '#FORM.FaxNumber#'
    <cfelse>
    NULL
    </cfif>
    , EmailAddress=
    <cfif IsDefined("FORM.emailaddress") AND #FORM.emailaddress# NEQ "">
    '#FORM.emailaddress#'
    <cfelse>
    NULL
    </cfif>
    WHERE CustomerID=#FORM.PrimaryID#
    </cfquery>
    <cflocation url="../testsuccessful.cfm?#CGI.QUERY_STRING#">
    </cfif>
    <cfquery name="Profile" datasource="gaswear">
    SELECT CustomerID, StationName, StoreNumber, FirstName, LastName, DOB,
    BillingAddress, City, StateOrProvince, PostalCode, PhoneNumber, Extension,
    FaxNumber, EmailAddress, UsernameConfirm FROM tblCustomer
    </cfquery><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta name ="keywords" content="gas station wearables, gas station clothing,
    gas wear, gas clothing"/>
    <title>gaswear.com</title>
    <link href="../Main.css" rel="stylesheet" type="text/css">
    <script language="JavaScript" type="text/JavaScript">
    <!--
    <!--

    function MM_preloadImages() { //v3.0
    var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length;
    i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }

    function MM_swapImgRestore() { //v3.0
    var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
    x.src=x.oSrc;
    }

    function MM_findObj(n, d) { //v4.01
    var p,i,x; if(!d) d=document;
    if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
    x=d.forms[i][n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++)
    x=MM_findObj(n,d.layers[i].document);
    if(!x && d.getElementById) x=d.getElementById(n); return x;
    }

    function MM_swapImage() { //v3.0
    var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array;
    for(i=0;i<(a.length-2);i+=3)
    if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc)
    x.oSrc=x.src; x.src=a[i+2];}
    }

    function YY_checkform() { //v4.71
    //copyright (c)1998,2002 Yaromat.com
    var
    a=YY_checkform.arguments,oo=true,v='',s='',err=fal se,r,o,at,o1,t,i,j,ma,rx,cd,cm
    ,cy,dte,at;
    for (i=1; i<a.length;i=i+4){
    if (a[i+1].charAt(0)=='#'){r=true;
    a[i+1]=a[i+1].substring(1);}else{r=false}
    o=MM_findObj(a[i].replace(/\[\d+\]/ig,""));
    o1=MM_findObj(a[i+1].replace(/\[\d+\]/ig,""));
    v=o.value;t=a[i+2];
    if (o.type=='text'||o.type=='password'||o.type=='hidd en'){
    if (r&&v.length==0){err=true}
    if (v.length>0)
    if (t==1){ //fromto
    ma=a[i+1].split('_');if(isNaN(v)||v<ma[0]/1||v > ma[1]/1){err=true}
    } else if (t==2){
    rx=new
    RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-zA-Z]{2,4}$");if(!rx.test(v))err=true;
    } else if (t==3){ // date
    ma=a[i+1].split("#");at=v.match(ma[0]);
    if(at){
    cd=(at[ma[1]])?at[ma[1]]:1;cm=at[ma[2]]-1;cy=at[ma[3]];
    dte=new Date(cy,cm,cd);

    if(dte.getFullYear()!=cy||dte.getDate()!=cd||dte.g etMonth()!=cm){err=true};
    }else{err=true}
    } else if (t==4){ // time
    ma=a[i+1].split("#");at=v.match(ma[0]);if(!at){err=true}
    } else if (t==5){ // check this 2
    if(o1.length)o1=o1[a[i+1].replace(/(.*\[)|(\].*)/ig,"")];
    if(!o1.checked){err=true}
    } else if (t==6){ // the same
    if(v!=MM_findObj(a[i+1]).value){err=true}
    }
    } else
    if (!o.type&&o.length>0&&o[0].type=='radio'){
    at = a[i].match(/(.*)\[(\d+)\].*/i);
    o2=(o.length>1)?o[at[2]]:o;
    if (t==1&&o2&&o2.checked&&o1&&o1.value.length/1==0){err=true}
    if (t==2){
    oo=false;
    for(j=0;j<o.length;j++){oo=oo||o[j].checked}
    if(!oo){s+='* '+a[i+3]+'\n'}
    }
    } else if (o.type=='checkbox'){

    if((t==1&&o.checked==false)||(t==2&&o.checked&&o1& &o1.value.length/1==0)){err=tr
    ue}
    } else if (o.type=='select-one'||o.type=='select-multiple'){
    if(t==1&&o.selectedIndex/1==0){err=true}
    }else if (o.type=='textarea'){
    if(v.length<a[i+1]){err=true}
    }
    if (err){s+='* '+a[i+3]+'\n'; err=false}
    }
    if (s!=''){alert('The required information is incomplete or contains
    errors:\t\t\t\t\t\n\n'+s)}
    document.MM_returnValue = (s=='');
    }
    //-->
    </script>
    <style type="text/css">
    <!--
    body {
    background-color: #666666;
    }
    .style7 {
    font-size: 13px;
    font-weight: bold;
    }
    .style8 {font-size: 13px}
    -->
    </style></head>
    <body
    onLoad="MM_preloadImages('file:///E|/CfusionMX/wwwroot/Images/navbar%20rollover/
    Shadowed/Login.gif','file:///E|/CfusionMX/wwwroot/Images/navbar%20rollover/Shado
    wed/Home.gif','file:///E|/CfusionMX/wwwroot/Images/navbar%20rollover/Non-Shadowe
    d%20Red/Contact-Us.gif','file:///E|/CfusionMX/wwwroot/Images/navbar%20rollover/N
    on-Shadowed%20Red/Shopping-Cart.gif','../Images/Navbar/Non-Shadowed%20Red/Home.g
    if','../Images/Navbar/Non-Shadowed%20Red/My-Account.gif','../Images/Navbar/Non-S
    hadowed%20Red/Store.gif','../Images/Navbar/Non-Shadowed%20Red/Track-it.gif','../
    Images/Navbar/Non-Shadowed%20Red/Contact-Us.gif','../Images/Navbar/Non-Shadowed%
    20Red/New-Customer.gif')">
    <div id="shell">
    <div id="header"></div>
    <div id="lowerleftcorner"><img src="../Images/Header/Right-Corner.gif"
    width="12" height="17"></div>
    <div id="lowerrightcorner"><img src="../Images/Header/Left-Corner.gif"
    width="17" height="12"></div>
    <span class="logout"><a
    href="<cfoutput>#CurrentPage#?MM_logout=1</cfoutput>">Log out</a></span>
    <div id="loginmember"> </div>
    <div id="home"><a href="Home.cfm" onMouseOut="MM_swapImgRestore()"
    onMouseOver="MM_swapImage('Home','','../Images/Navbar/Non-Shadowed%20Red/Home.gi
    f',1)"><img src="../Images/Navbar/Non-Shadowed/Homelowres.gif" alt="Home"
    name="Home" width="105" height="30" border="0"></a></div>
    <div id="Myacount"><a href="MyAccount.cfm"
    onMouseOut="MM_swapImgRestore()"
    onMouseOver="MM_swapImage('MyAccount','','../Images/Navbar/Non-Shadowed%20Red/My
    -Account.gif',1)"><img src="../Images/Navbar/Non-Shadowed/My-Accountlowres.gif"
    alt="My Account" name="MyAccount" width="105" height="30" border="0"></a></div>
    <div id="catalog"><a href="Store.cfm" onMouseOut="MM_swapImgRestore()"
    onMouseOver="MM_swapImage('Store','','../Images/Navbar/Non-Shadowed%20Red/Store.
    gif',1)"><img src="../Images/Navbar/Non-Shadowed/Storelowres.gif" alt="Store"
    name="St
    Hellyhansenv Guest

  6. #5

    Default Re: User Profile Update Page

    Ok......

    If the recordset you're using is to present the user with their existing
    details, then your filter will be whatever you're using to identify your user
    after they've logged in. In your case, you've used the DW login stuff, so you
    can use the session var MM_Username (which DW has inserted for you).

    You don't need any hidden fields in your form (apart from the ones DW puts in
    for the update behaviour), unless you want to send something to your database
    that your user isn't going to enter.

    Your bindings section will contain the recordset you're using to get your user
    profile data from the database.

    If all you want to do is update the existing data in your database, then you
    don't need the Insert behaviour, only the Update behaviour.

    Also, session management is not enabled by default on CF's server. You'll
    need a file called application.cfm which will need to contain something like:

    <cfapplication sessonmanagement="yes" setclientcookies="yes" name="user auth"
    sessiontimeout="#createtimespan(0,0,20,0)#">

    .....otherwise the session stuff will fail.

    MrBonk Guest

  7. #6

    Default Re: User Profile Update Page

    MrBonk,

    I thank you again for your advise as I just successfully finished my Update Profile page. It works great and will hopefully be live in the next couple of weeks.

    Thanks Again!
    -B- :D
    Hellyhansenv Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139