Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Feb 2014
    Posts
    20
    Member #
    38352

    Need script for showing/hiding login objects

    Hi, guys...

    I am kinda' new to Javascript and PHP ,so I need a script as follows:

    When a user is logged in ,I want the login object (Name it "Login") to be hidden and another object (Name it "UserName") to appear and vice versa (when there is no one logged in ,I want the "Login" object to appear and the "UserName" to hide)

    So it's a show/hide instructions in If/else condition stuff...

    I googled that ,but I didn't understand some things ,and I really need it now ,so anyone who knows the script ,please, show it to me


    Thank you for reading & any help will be appreciated

  2.  

  3. #2
    Junior Member
    Join Date
    Feb 2014
    Posts
    20
    Member #
    38352
    Is it that hard? Okay, just give me any resources site I can search ....

  4. #3
    Junior Member
    Join Date
    Feb 2014
    Posts
    20
    Member #
    38352
    Would any of the moderators
    move my post to a more popular
    forum?

  5. #4
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    What you're asking requires a good bit more than just a copy/paste script that we would post here. No one has any idea what you're applying this to or how it's written, if at all. No one knows if you have an existing login in place or not. My point is, this isn't a simple "oh, here you go!" kinda situation. To even give you resources is difficult, because you're asking for something that probably doesn't exist in one spot. You'll probably need multiple resources to put together the pieces of what you need, but no one knows what those pieces are.
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."

  6. #5
    Junior Member Hammadsiddiqui's Avatar
    Join Date
    Feb 2014
    Posts
    10
    Member #
    38554
    Liked
    1 times
    Well I think you should use sessions in php. When a session is saved then the php code will redirect to username if not than it will go to login And vice versa

    Sent from Samsung Galaxy S4 GTi9505

  7. #6
    Junior Member
    Join Date
    Nov 2013
    Location
    Cumbria, UK
    Posts
    4
    Member #
    37734
    easiest way would be to use PHP SESSIONS.

    So for example you could have something like this

    if($_SESSION['login']{

    echo 'You are logged in';

    } else {

    echo 'You are not logged in';

    }

    And if you wanted to use javascript, then just use ajax to call the script and display the results


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:48 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com