Miscellaneous Code

  Home arrow Miscellaneous Code arrow Change page objects color using sessio...
MISCELLANEOUS CODE

Change page objects color using session
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2004-11-10

    Table of Contents:

     
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement
    using session with style tags one can change the color of table or form input

    By : khabir

    <? @session_start();
    $_SESSION['color']=$_POST['col'];
    $_SESSION['sel']=$_POST['inp'];
    $_SESSION['inp']=$_POST['inp'];
    echo 'Table background color: ',$_POST['col'];

    ?>
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    <!--
    table {
    background-color: <? if($_SESSION['color']!='') echo $_SESSION['color']; else echo '#999900'; ?>;
    }
    td {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: bolder;
    color: #CCFF66;
    }

    input {
    background-color:<? if($_SESSION['inp']!='') echo $_SESSION['inp']; else echo '#663399'; ?>
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #FF0000;
    }
    select {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #FFFFFF;
    background-color:<? if($_SESSION['sel']!='') echo $_SESSION['sel']; else echo '#669999'; ?>
    }
    -->
    </style>
    </head>
    <!--
    Save this page as color.php
    Author: Md. khabir uddin khan
    mdkhabir@yahoo.com
    -->
    <body>
    <form name="form1" method="post" >
    <table width="60%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
    <tr>
    <td width="31%">&nbsp;</td>
    <td width="69%">&nbsp;</td>
    </tr>
    <tr>
    <td height="26">
    <div align="right">Change Color:</div></td>
    <td><select name="col" id="col">
    <option value="#336600">#336600</option>
    <option value="#999966">#999966</option>
    <option value="#669966">#669966</option>
    <option value="#ef5966">#ef5966</option>
    <option value="#3366ff">#3366ff</option>
    <option value="#ff6600">#ff6600</option>
    </select></td>
    </tr>
    <tr>
    <td><div align="right">Change input Color:</div></td>
    <td><select name="inp" id="inp">
    <option value="#339900">#339900</option>
    <option value="#335566">#335566</option>
    <option value="#66f9ff">#66f9ff</option>
    <option value="#efdf66">#efdf66</option>
    <option value="#fd66ff">#fd66ff</option>
    <option value="#ff66cc">#ff66cc</option>
    </select></td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td><input type="submit" name="Submit" value="Submit"></td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    </table>
    </form>
    </body>
    </html>

    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More Miscellaneous Code Articles
    More By Codewalkers

    blog comments powered by Disqus

    MISCELLANEOUS CODE ARTICLES

    - Creating a Web Page Controller with the HMVC...
    - Coding Controllers and Views for the HMVC De...
    - A Sample Web Application with the HMVC Desig...
    - Adding a Class to Parse Views to an HMVC Des...
    - Building a Model Class for the HMVC Design P...
    - Filtering Input Data and Generating HTML For...
    - The HMVC Design Pattern: Working with MySQL ...
    - Dispatching Requests to MVC Triads with the ...
    - Implementing the Hierarchical Model-View-Con...
    - A Web App Based on a Model for the CodeIgnit...
    - Completing a Model for the CodeIgniter PHP F...
    - Validating Input Data with the CodeIgniter P...
    - Deleting Database Records with the CodeIgnit...
    - Inserting Database Records with a CodeIgnite...
    - Fetching Database Rows with a Model for the ...


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 6 - Follow our Sitemap