News World
May 20, 2011
Color Management of Page With PHP and Java Script (1st Page)
1.Color Management of Page With PHP and Java Script (1st Page)
2.
3. --------------------------------------------------
4. Create file color-page-management.php in to "nature" folder
5. --------------------------------------------------
6.
7. Create Table
8. CREATE TABLE `eod`.`tbpcolor` (
9. `idp` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
10. `ipnumber` TEXT NOT NULL ,
11. `ptop` TEXT NOT NULL ,
12. `pleft` TEXT NOT NULL ,
13. `pcontent` TEXT NOT NULL ,
14. `txtop` TEXT NOT NULL ,
15. `txleft` TEXT NOT NULL ,
16. `txcontent` TEXT NOT NULL
17.
18. copy the script below to color-page-management.php
20. --------------------------------------------------
21.
22. < ? php
23. $db_hname = "localhost";
24. $db_uname = "root";
25. $db_pword = "";
26. $db_name = "eod";
27. $link = mysql_connect($db_hname, $db_uname, $db_pword) or die("Not Success ....!");
28. if (!$link) { die('Could not connect: ' . mysql_error()); }
29. mysql_select_db($db_name);
31. $ltable = mysql_list_tables($db_name);
32. $ipa = $_SERVER["SERVER_ADDR"];
33. $tu = mysql_query("select * from tbpcolor where ipnumber='".$ipa."'");
34. $dtu = mysql_fetch_array($tu);
35. if($dtu['ipnumber']!==''){
36. mysql_query("insert into tbpcolor set ipnumber='".$ipa."',txtop='#000000', txleft='#000000', txcontent='#000000");
37. }
38. if($dtu['ptop']==''){
39. $wrnt = '#CCFF66';
40. $wrnl = '#FFFF00';
41. $wrnc = '#F3F3F3';
42. }else
43. {
44. $wrnt = $dtu['ptop'];
45. $wrnl = $dtu['pleft'];
46. $wrnc = $dtu['pcontent'];
47. }
48. if($_POST['smcolor']!=''){
49. mysql_query("UPDATE tbpcolor SET ptop='".$_POST['txttop']."', pleft ='".$_POST['txtleft']."', pcontent = '".$_POST['txtcon']."'");
50. ? >
51. < SCRIPT language="JavaScript" >
52.
53. window.location="oth1.php";
54.
55. < /SCRIPT >
56. < ? php
57. }
58. ? >
59. < script >
60.
61. function chgBgTop()
62. {
63. var a1, a2, a3, a4, a5, a6, a7;
64. a1 = document.all.slh1.value; a2 = document.all.slh2.value; a3 = document.all.slh3.value;
65. a4 = document.all.slh4.value; a5 = document.all.slh5.value; a6 = document.all.slh6.value;
66. document.all.tdwt.bgColor = "#"+a1+a2+a3+a4+a5+a6;
67. document.all.txttop.value= "#"+a1+a2+a3+a4+a5+a6;
68. return;
69. }
70. function chgBgLeft()
71. {
72. var b1, b2, b3, b4, b5, b6, b7;
73. b1 = document.all.sl1.value; b2 = document.all.sl2.value; b3 = document.all.sl3.value;
74. b4 = document.all.sl4.value; b5 = document.all.sl5.value; b6 = document.all.sl6.value;
75. document.all.tdwl.bgColor = "#"+b1+b2+b3+b4+b5+b6;
76. document.all.txtleft.value = "#"+b1+b2+b3+b4+b5+b6;
77. return;
78. }
79. function chgBgCon()
80. {
81. var c1, c2, c3, c4, c5, c6, c7;
82. c1 = document.all.sc1.value; c2 = document.all.sc2.value; c3 = document.all.sc3.value;
83. c4 = document.all.sc4.value; c5 = document.all.sc5.value; c6 = document.all.sc6.value;
84. document.all.tdwc.bgColor = "#"+c1+c2+c3+c4+c5+c6;
85. document.all.txtcon.value = "#"+c1+c2+c3+c4+c5+c6;
86. return;
87. }
88.
89. < / script >
90.
91. < table border=0 cellpadding=0 cellspacing=0 width=100% height=100% >
92. < tr >
93. < td id='tdwt' bgcolor= '< ? php echo $wrnt;? >' colspan=3 height=80 style='font-family: arial;vertical-align:top;text-align:left;padding-left:10px;padding-top:10px; border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#FFFFFF'>Top Page< /td >
94. < /tr >
95.
96. < tr >
97. < td id='tdwl' bgcolor= '< ? php echo $wrnl;? >' width=200 style='font-family: arial;vertical-align:top;text-align:left;padding-left:10px;padding-top:10px;'>Menu Page< /td >
98. < td id='tdwc' bgcolor= '< ? php echo $wrnc;? >' style='font-family: arial;vertical-align:top;text-align:left;padding-left:10px;padding-top:10px;'>
99. Contents Page
100.
101. < /td >
102. < td width=200 style='font-family: arial;font-size:11px;vertical-align:top;background-color: #C1EBFF;text-align:left;padding-left:10px;padding-right:10px;padding-top:10px;'>
Subscribe to:
Post Comments (Atom)
IT Conversations
Moneycontrol Latest News
Latest new pages on Computer Hope
Latest from Infoworld
Door Lock
Door Lock Import Top Door Lock from China Contact Quality Manufacturers Now
No comments:
Post a Comment