42 users online (0 members and 42 guests)  


  Results 1 to 2 of 2

Related

  1. Styles for forms and elements    Forum: CSS Forum
    Replies: 5
  1. #1
    glmoneoxtec's Avatar
    New User

    Status
    Offline
    Join Date
    Sep 2003
    Posts
    1

    Question CSS, styles and PHP

    Hello and thanks for having me in the forum.

    My boss has a request and I need some assistance. Is there a way in PHP to assign a formatted style to an individual form/db field based on the user permissions.

    For example, he needs to pass three specific styles: Universal (Read/Write in the field and visible), Read_Only (Read the field only and visible as grayed-out text), and Nothing_Allowed (field not visible).

    If I create a style (using standard CSS) how would PHP then pass that code at the field level?

    I am very familiar with HTML and CSS but PHP is ancient Greek to me. If I create a standard style-sheet document can he then take that and use it to program the script for each field.

    Anyway, If I sound confused, I am.

    Thanks for the help.

    George Moneo (gmoneo@xtec.com)
    Documentation Manager
    XTec, Incorporated

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Hi George,

    I am sure PHP can do 90% of what you need here. Be aware, tho, that mostly this we will just a case of using good old-fashioned html.

    one of the useful things about PHP is that it can write HTML. Here is a simplified example -

    Code:
    <input type="text" name="badger" <?php 
    if ($readonly == TRUE)
    {
    echo 'readonly';
    }
    ?> >
    This example shows that if the variable $readonly is true, then php adds 'readonly' where it is, which is in the input tag.

    best bet, if your starting from scratch, is to look at examples and the manual @ http://www.php.net/
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?



Tags for this Thread