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.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
Like Tree2Likes

Thread: Same index page but different users!

  1. #1
    Junior Member
    Join Date
    Mar 2021
    Posts
    8
    Member #
    62570

    Same index page but different users!

    I am a rookie html/css user so have mercy on me!

    I have the following web page created for a video broadcaster:

    index page.JPG

    I need the same page to look like this when a video viewer calls the page:

    index page viewers.jpg

    Notice missing buttons for viewers. And I would need the "Start" to be removed. Join only!

    How would you accomplish this?

    Thanks,

    Ray
    Last edited by rayj2021; Mar 10th, 2021 at 03:14 PM.

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,980
    Member #
    5580
    Liked
    761 times
    Ray, typically there is PHP scripting that processes the users logins and changes what appears on pages based on userís status. Does your website use PHP for the user logins?
    What scripting happens when buttons are pressed and how do they login?
    Last edited by mlseim; Mar 10th, 2021 at 05:21 PM.

  4. #3
    Junior Member
    Join Date
    Mar 2021
    Posts
    8
    Member #
    62570
    Thanks for the response.

    At this point I don't have any authentication. I do use PHP to upload video's to the server.

    Ray

  5. #4
    Member Cutler's Avatar
    Join Date
    Feb 2021
    Posts
    41
    Member #
    62526
    Liked
    7 times
    You can make a conditional if statement for assigning classes. Then add a ".userLoggedIn" class to the buttons and have "display: none;" on the styling or any additional changes required.

    I'm always prone to toggle class. You could however, just make a whole other set of content for the logged in user and use an if statement to determine which one you display.
    $1/year Portfolio Hosting with Promo Code: WEBDESIGNFORUMS

    Agency: Marshalled Makers
    Hosting: Marshalled Makers Hosting

  6. #5
    Junior Member
    Join Date
    Mar 2021
    Posts
    8
    Member #
    62570
    Thanks for the response.

    At this point I don't have any authentication. I do use PHP to upload video's to the server.

    Ray

  7. #6
    Junior Member
    Join Date
    Mar 2021
    Posts
    8
    Member #
    62570
    Quote Originally Posted by martincorteze View Post
    As for me would be better looking for professional help. The main advantages of a custom software development company are that it provides a tailor-made solution to organizations.
    Understood. But I am basically dabbling in html/css and webrtc video. I have no schedule, but if I can accomplish my goals, I may turn it loose on the public!

  8. #7
    Junior Member
    Join Date
    Mar 2021
    Posts
    8
    Member #
    62570
    I guess my question is how to distinguish between two different types of users. One user would be a video broadcaster and all of the rest would be the viewers of the broadcast video.

  9. #8
    Junior Member
    Join Date
    Mar 2021
    Posts
    8
    Member #
    62570
    Quote Originally Posted by Cutler View Post
    You can make a conditional if statement for assigning classes. Then add a ".userLoggedIn" class to the buttons and have "display: none;" on the styling or any additional changes required.

    I'm always prone to toggle class. You could however, just make a whole other set of content for the logged in user and use an if statement to determine which one you display.
    Being a newbe with css I would not know where to start with your suggestion.

  10. #9
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,980
    Member #
    5580
    Liked
    761 times
    The point is, when someone visits your web page, you have no way of knowing if they are logged in or not.

    If you want people to "join", you need to have a way for them to join. That means you need a PHP membership script where they can "join" ... or "register" to be a member. Once they are members and log-in, you will now know if the person is logged in or not logged in and display pages accordingly.

    Members would be assigned either as a "viewer" or "broadcaster", or "admin", etc.

    Even with others here giving you ideas on how to "show" or "not show" different things on the screen, you still need to know if the person viewing your page is logged-in or not logged-in.

    So getting back to PHP. You said you use PHP to upload videos. Is that on a page that is "secret" to you? You're not letting anyone that visits your site to upload videos are you?

    EDIT:
    And just so you know how it works ...
    With a PHP script, when a person enters their username and password, the PHP script finds them in a database and determines if the login has correct username and password. If it does, it creates a SESSION "ID" which is stored on the server and stored as a small cookie (SESSION KEY) on the user's computer. Now you will be able to use a few SESSION variables to know what role the user is (viewer, broadcaster, etc). No matter what page the user visits, you will always be able to see their information. When they logout, the SESSION expires. Or, when they close their browser, the SESSION expires. And by "you", I mean your web page, which is a PHP script itself. Instead of index.html, you have index.php

    When index.php is viewed (executed), it is a PHP script that processes everything and displays the web page.

    This page you are on now (web design forums) is a PHP script. You have logged in and these pages are dynamically generated by PHP. As a WDF Staff member, I can do things you cannot do. It knows what my user role is. I'm seeing the pages differently than you see them.

    There is no other way to do this unless you use PHP, Perl or some other server-side scripting. Javascripting will not work (and is also not secure).

    Since you have no PHP scripting experience, you can either hire someone to help you, or it might be possible that your webhost already has a feature that they provide for their customers using their own web page creation software. Like a "web builder".
    Last edited by mlseim; Mar 11th, 2021 at 08:11 PM.
    rayj2021 and Cutler like this.


  11. #10
    Junior Member
    Join Date
    Mar 2021
    Posts
    8
    Member #
    62570
    Thanks for the comprehensive response mlseim. The PHP I use to upload the video is strictly for the broadcaster only and applies to the broadcast he just
    streamed. He starts the recording and when he is done he stops it. Then the uploading happens transparently. That's one reason I need to differentiate the broadcaster from a simple viewer. I was thinking that I need some sort of authentication process.

    I should have included the following technologies I am using. I am using LXD containers to hold a node.js http server for my webpage and I use Apache2/PHP for the video uploading process.. Note that Node does not support PHP natively. That's the reason for Apache2/PHP. I am also using mysql on the node server for saving some information that previously used the browser local storage.

    I am using another container for Haproxy to direct incoming URL to the proper container. (I have multiple containers used for other things)

    There are a few tutorials on authentication for the node server itself that I am researching. There is also an authentication process for haproxy, but it is limited in nature.

    I realize there is probably a much simpler way to do what I want but the node server was freeware and working. I am just modifying it for what I want it to do (ex: record and store).

    Thanks,

    Ray


Page 1 of 2 1 2 LastLast

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 06:20 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2022 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com