welcome script?

  • gophw1
  • Newbie
  • Newbie
  • gophw1
  • Posts: 12

Post 3+ Months Ago

Not sure what you would call it but looking for a script that would display a "Welcome ------" after they login to a site.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • ScottG
  • Proficient
  • Proficient
  • ScottG
  • Posts: 477

Post 3+ Months Ago

?? Well do you have the login system in place? Because there is several thing needed to be known for this. If there is one in place could you post an example of the code?

OR

Did you need a login system?
  • ScottG
  • Proficient
  • Proficient
  • ScottG
  • Posts: 477

Post 3+ Months Ago

Also if you have a login system is it in PHP, ASP or some other server side script?
  • gophw1
  • Newbie
  • Newbie
  • gophw1
  • Posts: 12

Post 3+ Months Ago

Sorry, I guess I should have been a bit clearer.
Yes we have a login in place, just trying to make user experience a bit more appealing/friendly.

Current login code

Code: [ Select ]
<div class="login">
        <asp:Login ID="Login1" runat="server" DestinationPageUrl="" InstructionText=" account" TitleText="" PasswordRecoveryText="Forgot your password?" PasswordRecoveryUrl="~/passwordrecovery.aspx">
          <LoginButtonStyle CssClass="button" />
          <LayoutTemplate>
            <table border="0" cellpadding="1" cellspacing="0" style="border-collapse: collapse">
              <tr>
                <td>
                  <table border="0" cellpadding="0">
                    <tr>
                      <td align="center" colspan="2">
                        Sign in with your account</td>
                    </tr>
                    <tr>
                      <td align="right">
                        <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label></td>
                      <td>
                        <asp:TextBox ID="UserName" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                          ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator>
                      </td>
                    </tr>
                    <tr>
                      <td align="right">
                        <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label></td>
                      <td>
                        <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                          ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator>
                      </td>
                    </tr>
                    <tr>
                      <td colspan="2">
                      </td>
                    </tr>
                    <tr>
                      <td align="center" colspan="2" style="color: red">
                        <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
                      </td>
                    </tr>
                    <tr>
                      <td align="right" colspan="2">
                        <asp:Button ID="LoginButton" runat="server" CommandName="Login" CssClass="button"
                          Text="Log In" ValidationGroup="Login1" />
                      </td>
                    </tr>
                    <tr>
                      <td colspan="2">
                        <asp:HyperLink ID="PasswordRecoveryLink" runat="server" NavigateUrl="~/passwordrecovery.aspx">Forgot your password?</asp:HyperLink>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </LayoutTemplate>
        </asp:Login>
        <asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="Login1" />
      </div>
  1. <div class="login">
  2.         <asp:Login ID="Login1" runat="server" DestinationPageUrl="" InstructionText=" account" TitleText="" PasswordRecoveryText="Forgot your password?" PasswordRecoveryUrl="~/passwordrecovery.aspx">
  3.           <LoginButtonStyle CssClass="button" />
  4.           <LayoutTemplate>
  5.             <table border="0" cellpadding="1" cellspacing="0" style="border-collapse: collapse">
  6.               <tr>
  7.                 <td>
  8.                   <table border="0" cellpadding="0">
  9.                     <tr>
  10.                       <td align="center" colspan="2">
  11.                         Sign in with your account</td>
  12.                     </tr>
  13.                     <tr>
  14.                       <td align="right">
  15.                         <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label></td>
  16.                       <td>
  17.                         <asp:TextBox ID="UserName" runat="server"></asp:TextBox>
  18.                         <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
  19.                           ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator>
  20.                       </td>
  21.                     </tr>
  22.                     <tr>
  23.                       <td align="right">
  24.                         <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label></td>
  25.                       <td>
  26.                         <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
  27.                         <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
  28.                           ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator>
  29.                       </td>
  30.                     </tr>
  31.                     <tr>
  32.                       <td colspan="2">
  33.                       </td>
  34.                     </tr>
  35.                     <tr>
  36.                       <td align="center" colspan="2" style="color: red">
  37.                         <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
  38.                       </td>
  39.                     </tr>
  40.                     <tr>
  41.                       <td align="right" colspan="2">
  42.                         <asp:Button ID="LoginButton" runat="server" CommandName="Login" CssClass="button"
  43.                           Text="Log In" ValidationGroup="Login1" />
  44.                       </td>
  45.                     </tr>
  46.                     <tr>
  47.                       <td colspan="2">
  48.                         <asp:HyperLink ID="PasswordRecoveryLink" runat="server" NavigateUrl="~/passwordrecovery.aspx">Forgot your password?</asp:HyperLink>
  49.                       </td>
  50.                     </tr>
  51.                   </table>
  52.                 </td>
  53.               </tr>
  54.             </table>
  55.           </LayoutTemplate>
  56.         </asp:Login>
  57.         <asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="Login1" />
  58.       </div>


I've been looking around and I guess it would be called an authentication script which would take the login details and return a "welcome back username" message.
  • gophw1
  • Newbie
  • Newbie
  • gophw1
  • Posts: 12

Post 3+ Months Ago

Also, this is what is currently there and I'm adding some features so if there is a neater/cleaner way I'm open to it, just don't want to re-invent the wheel if I don't have to.
  • gophw1
  • Newbie
  • Newbie
  • gophw1
  • Posts: 12

Post 3+ Months Ago

OK, so I've been looking through all the files and found one and it would appear that someone tried to implement this already, could it really be this simple??

Code: [ Select ]
<div class="title">Welcome to the Regional Web Portal <asp:LoginName ID="LoginName1" runat="server" /></div>
        <asp:LoginStatus ID="LoginStatus1" runat="server" />
  1. <div class="title">Welcome to the Regional Web Portal <asp:LoginName ID="LoginName1" runat="server" /></div>
  2.         <asp:LoginStatus ID="LoginStatus1" runat="server" />
  • ScottG
  • Proficient
  • Proficient
  • ScottG
  • Posts: 477

Post 3+ Months Ago

Just to let you know I am not an ASP coder but will try to help out anyway I have no way to test ASP so with that being said with PHP as well as ASP there are session variables that can be set. I'm not sure if you are setting any or not. based on the code you provided you could try to do.

Code: [ Select ]
Welcome <%Response.Write(Session("UserName"))%>


If that doesn't work and you know where the asp processing page is you can set the users name then use the example above

Code: [ Select ]
Session("username")= "the users login user name"
Session("firstname")= "if there's sql that can be use the users first name"
Session("lastname")= "and the users last name"

Welcome <%Response.Write(Session("username"))%> (or) Welcome <%Response.Write(Session("firstname"))%> <%Response.Write(Session("lastname"))%>
  1. Session("username")= "the users login user name"
  2. Session("firstname")= "if there's sql that can be use the users first name"
  3. Session("lastname")= "and the users last name"
  4. Welcome <%Response.Write(Session("username"))%> (or) Welcome <%Response.Write(Session("firstname"))%> <%Response.Write(Session("lastname"))%>


To check for what sessions are set you could do this
Code: [ Select ]
<%
dim i
For Each i in Session.Contents
 Response.Write(i & "<br>")
Next
%>
  1. <%
  2. dim i
  3. For Each i in Session.Contents
  4.  Response.Write(i & "<br>")
  5. Next
  6. %>

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 143 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.