Changing Colors Code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Changing Colors Code

    hi, is it possible to put on a chat in txt files a select code for changing background colors on chat page?..
    something like this..


    echo "choose colors: <select name=\"colors\">";
    echo "<option value=body bgcolor=\"white\" link=\"#0000CC\" vlink=\"#0000CC\" alink=\"#0000CC\">white</option>";
    echo "<option value=body bgcolor=\"blue\" link=\"#0000CC\" vlink=\"#0000CC\" alink=\"#0000CC\">blue</option>";
    echo "<option value=body bgcolor=\"yellow\" link=\"#0000CC\" vlink=\"#0000CC\" alink=\"#0000CC\">yellow</option>";
    echo "</select>
    ";
    sigpicthe italian/international COMMUNITY of friendship
    http://people2000.netne.net
    WAP/WEB
    peoplemailbox@katamail.com

    #2
    something like this:

    echo "choose colors: <select name=\"colors\">";
    echo "<option value=\"white\">white</option>";
    echo "<option value=\"blue\">blue</option>";
    echo "<option value=\"yellow\">yellow</option>";
    echo "</select>
    ";

    //////////////////////////////////////////////
    your adjusting page:

    $colors = $_POST["colors"];

    if($colors=="white"){
    $bgcolor = "$colors";
    $link = "#0000CC";
    }else if($colors=="blue"){
    $bgcolor = "$colors";
    $link = "#0000CC";
    }else if($colors=="yellow"){
    $bgcolor = "$colors";
    $link = "#0000CC";
    }

    then update to txt

    Comment


      #3
      maybe i&#39;ve done ,of course ,somethin&#39; wrong....it don&#39;t works..

      i&#39;ve put on the top of chat.php page the code:
      =================

      $colors = $_POST["colors"];

      if($colors=="white"){
      $bgcolor = "$colors";
      $link = "#0000CC";


      }else if($colors=="blue"){
      $bgcolor = "$colors";
      $link = "#0000CC";



      }else if($colors=="yellow"){
      $bgcolor = "$colors";
      $link = "#0000CC";

      }
      ==============
      and then:
      ===============
      echo "<form action=\"chat.php\" method=\"post\">\n";
      echo "choose colors: <select name=\"colors\">";
      echo "<option value=\"white\">white</option>";
      echo "<option value=\"blue\">blue</option>";
      echo "<option value=\"yellow\">yellow</option>";
      echo "</select>
      ";
      echo "<input type=\"submit\" value=\"ok\">
      \n";
      sigpicthe italian/international COMMUNITY of friendship
      http://people2000.netne.net
      WAP/WEB
      peoplemailbox@katamail.com

      Comment


        #4
        changing colors without txt php only

        Code:
        <? 
        $today = date("l");
        print("$today");
          if($today == "Sunday") 
          {
             $bgcolor = "#FEF0C5";
          }
          elseif($today == "Monday")
          {
             $bgcolor = "#FFFFFF";
          } 
          elseif($today == "Tuesday") 
          {
             $bgcolor = "#FBFFC4";
          } 
          elseif($today == "Wednesday")
          {
             $bgcolor = "#FFE0DD";
          } 
          elseif($today == "Thursday")
          {
             $bgcolor = "#E6EDFF";
          } 
          elseif($today == "Friday") 
          {
             $bgcolor = "#E9FFE6";
          } 
          else 
          {
             // Since it is not any of the days above it must be Saturday
             $bgcolor = "#F0F4F1";
          }
        print("<body bgcolor=\"$bgcolor\">\n"); 
        ?>
        Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!

        <span style="color:#9ACD32"><span style="font-size:36pt;line-height:100%">BEST MOBILE ADVERTISER</span></span>

        Comment


          #5
          fine it, but i&#39;d need
          a choose color code to
          make the bg color change by user on line
          ;)
          sigpicthe italian/international COMMUNITY of friendship
          http://people2000.netne.net
          WAP/WEB
          peoplemailbox@katamail.com

          Comment


            #6
            here function

            Code:
            function gettheme($uid)
            {
                $thid = mysql_fetch_array(mysql_query("SELECT thid FROM ibwf_mypage WHERE uid=&#39;".$uid."&#39;"));
                if($thid[0]==""||$thid[0]==0)$thid[0]=1;
                $thinfo = mysql_fetch_array(mysql_query("SELECT bgc, txc, lnk, hdc, hbg, brdr FROM ibwf_themes WHERE id=&#39;".$thid[0]."&#39;"));
                $ret = "<style type=\"text/css\">\n";
                $ret .= "body {background-color:#$thinfo[0]; font-family : Comic Sans MS; font-size: medium; margin: 0px; padding: 2px; color:#$thinfo[1]}\n";
                  $ret .= "p {padding:0px;}\n";
                  $ret .= "input, select {color:#$thinfo[1]; border: 1px ridge #$thinfo[5]; font-family: Comic Sans MS, Tahoma, Verdana; font-weight: bold; background-color:#$thinfo[0]}\n";
                  $ret .= "* {text-decoration:none;}\n";
                  $ret .= "img {border: 0px none;}\n";
                  $ret .= "a, a:active, a:visited, a:hover {color:#$thinfo[2];}\n";
                  $ret .= "head {font-family : Comic Sans MS; font-size: medium;}\n";
                  $ret .= "div {margin: 2px 0px 2px 0px; padding: 2px 0px 2px 0px; color: #$thinfo[0]; background-color: #$thinfo[5]; border: 1px solid #$thinfo[2]; text-align: center;}\n";
                $ret .= "h3 {background-color:#$thinfo[4]; color:#$thinfo[3]}\n";
                $ret .= "</style>";
                return $ret;
            }
            rest u must to code
            Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!

            <span style="color:#9ACD32"><span style="font-size:36pt;line-height:100%">BEST MOBILE ADVERTISER</span></span>

            Comment


              #7
              thanks, but maybe i didn&#39;t explain good.
              my chat works on php xhtml with txt files (no database sql)

              so what i need is a a simple choose colors php code( without queries of course) to get on chat page
              that could work on it (if is it possible)

              sigpicthe italian/international COMMUNITY of friendship
              http://people2000.netne.net
              WAP/WEB
              peoplemailbox@katamail.com

              Comment


                #8
                oh ok
                Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!

                <span style="color:#9ACD32"><span style="font-size:36pt;line-height:100%">BEST MOBILE ADVERTISER</span></span>

                Comment


                  #9
                  something like?

                  Code:
                  <?php 
                  $text_size = $_POST[&#39;text_size&#39;]; 
                  $font = Trim(stripslashes($_POST[&#39;font&#39;])); 
                  $colour = Trim(stripslashes($_POST[&#39;colour&#39;])); 
                  $brief_colour = Trim(stripslashes($_POST[&#39;brief_colour&#39;])); 
                  $yellow = yellow; 
                  echo $text_size, $font, $colour, $brief_colour, $yellow; 
                  ?>
                  
                  
                  
                  
                   Size of text 
                  <select name="text_size"> 
                  <option value ="10">10pt</option> 
                  <option value ="20">20pt</option> 
                  <option value ="30" selected="selected">30pt</option> 
                  <option value ="60">60pt</option> 
                  </select> 
                  
                  Font style <select name="font"> 
                  <option value ="verdana">Verdana</option> 
                  <option value ="trebuchet">Trebuchet</option> 
                  <option value ="helvetica" selected="selected">Helvetica</option> 
                  <option value ="arial">Arial</option> 
                  </select> 
                  
                  Font colour <select name="colour"> 
                  <option value ="black">Black</option> 
                  <option value ="white">White</option> 
                  <option value ="red">Red</option> 
                  <option value ="yellow" selected="selected">Yellow</option> 
                  </select> 
                  
                  Brief colour <select name="brief_colour"> 
                  <option value ="black">Black</option> 
                  <option value ="white">White</option> 
                  <option value ="red" selected="selected">Red</option> 
                  <option value ="yellow">Yellow</option> 
                  </select> 
                  
                  
                  <input type="submit" name="submit" value="Show me this text on my briefs"/></p></form>
                  Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!

                  <span style="color:#9ACD32"><span style="font-size:36pt;line-height:100%">BEST MOBILE ADVERTISER</span></span>

                  Comment


                    #10
                    usase
                    Code:
                    <?php 
                    $text_size = $_POST[&#39;text_size&#39;]; 
                    $font = Trim(stripslashes($_POST[&#39;font&#39;])); 
                    $colour = Trim(stripslashes($_POST[&#39;colour&#39;])); 
                    $brief_colour = Trim(stripslashes($_POST[&#39;brief_colour&#39;])); 
                    $yellow = &#39;yellow&#39;; // dont know what this is 
                    $text = $_POST[&#39;personalise&#39;]; 
                    echo "<p style=\"font-family:$font; background-color:$brief_colour; color:$colour; font-size:$text_size;\">\n
                    
                    
                    \n"; 
                    ?>
                    Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!

                    <span style="color:#9ACD32"><span style="font-size:36pt;line-height:100%">BEST MOBILE ADVERTISER</span></span>

                    Comment


                      #11
                      something like this..
                      <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><form name="test" method="post">

                      <input type="button"
                      OnClick="document.bgColor = &#39;#FFFFFF&#39;;"
                      value="White">

                      <input type="button"
                      OnClick="document.bgColor = &#39;#00FFFF&#39;;"
                      value="Cyan">

                      <input type="button"
                      OnClick="document.bgColor = &#39;#FF00FF&#39;;"
                      value="Purple">

                      <input type="button"
                      OnClick="document.bgColor = &#39;#FFFF00&#39;;"
                      value="Yellow">

                      </form></div>
                      but working in php..
                      sigpicthe italian/international COMMUNITY of friendship
                      http://people2000.netne.net
                      WAP/WEB
                      peoplemailbox@katamail.com

                      Comment


                        #12
                        if its not working in php then close php and reopen it after that code

                        Comment


                          #13
                          do u want this?
                          Attached Files
                          Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!

                          <span style="color:#9ACD32"><span style="font-size:36pt;line-height:100%">BEST MOBILE ADVERTISER</span></span>

                          Comment


                            #14
                            do u want this?[/b]
                            <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>?><script>
                            <!--
                            document.write(unescape("%3Chtml%3E%0D%0A%3Chead%3 E%0D%0A%3CSCRIPT%20language%3D%22JavaScript%22%3E% 0D%0A%3C%21--%20hide%20javascript%0D%0A%0D%0Afunction%20changeB ackground%28hexNumber%29%20%7B%0D%0A%20%20%20docum ent.bgColor%3DhexNumber%3B%0D%0A%7D%0D%0A%0D%0A//%20done%20hiding%20--%3E%0D%0A%3C/SCRIPT%3E%0D%0A%3C/head%3E%0D%0A%3Cbody%3E%0D%0A%0D%0A%3CFORM%20metho d%3D%22post%22%20name%3D%22background%22%3E%0D%0A% 3CINPUT%20type%3D%22button%22%20value%3D%22red%22% 0D%0A%20onclick%3D%22changeBackground%28%27%23cc00 00%27%29%22%3E%0D%0A%3CINPUT%20type%3D%22button%22 %20value%3D%22green%22%0D%0A%20onclick%3D%22change Background%28%27%23006600%27%29%22%3E%0D%0A%3CINPU T%20type%3D%22button%22%20value%3D%22yellow%22%0D% 0A%20onclick%3D%22changeBackground%28%27%23ffff99% 27%29%22%3E%0D%0A%3CINPUT%20type%3D%22button%22%20 value%3D%22white%22%0D%0A%20onclick%3D%22changeBac kground%28%27%23ffffff%27%29%22%3E%0D%0A%3CINPUT%2 0type%3D%22button%22%20value%3D%22black%22%0D%0A%2 0onclick%3D%22changeBackground%28%27%23000000%27%2 9%22%3E%0D%0A%3CINPUT%20type%3D%22button%22%20valu e%3D%22grey%22%0D%0A%20onclick%3D%22changeBackgrou nd%28%27%23666666%27%29%22%3E%0D%0A%3C/FORM%3E%0D%0A%0D%0A%3C/body%3E%0D%0A%3C/html%3E"));
                            //-->
                            </script><?</div>

                            yeah this script works! but there&#39;s a problem.. when chat page refresh.. color back to default..
                            sigpicthe italian/international COMMUNITY of friendship
                            http://people2000.netne.net
                            WAP/WEB
                            peoplemailbox@katamail.com

                            Comment


                              #15
                              lol u must to make proper session(); i pm u this script ok?
                              Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!

                              <span style="color:#9ACD32"><span style="font-size:36pt;line-height:100%">BEST MOBILE ADVERTISER</span></span>

                              Comment

                              Working...
                              X