Question

In: Computer Science

Hi, I am trying to write a php file which control the text size, color and...

Hi, I am trying to write a php file which control the text size, color and the parameters of a registration page. My code is not working, the registration page always stay in the default color.
Could I get some help ? My code is below.

display file

<?php session_start() ?>
<!DOCTYPE html>
<html>
<head>
   <meta charset="UTF-8">
   <title>User display window</title>
   <style>
       .center { text-align:center}
       </style>
   </head>
<body>
   <fieldset>
       <legend class="center">Text editing control </legend>
           <form class="center" name="session_editing" action="process.php" method="post">
               <label for="style">Select a control to style </style></br>
                   <select class="form_control" name="controlF" required>
                       <option value="backG">Background </option>
                       <option value="logIn">Login button</option>
                       <option value="inputText">Input text </option>
                   </select></br></br>
               <label for="font_size">Select the font size</label></br>
                   <input class="form_control" type="range" name="fontS" min="6" max="42" required></br></br>
               <label for="color_pick">Select the color</label></br>
                   <input class="form_control" type="color" name="color" required></br></br>
               <label for="visibility">
                   <input type="checkbox" name="visible">Select the visibility</label></br></br>
                   <input type="submit" value="Submit">
           </form>
       </fieldset>
   </body>
</html>

process file...

<?php
   session_start(); ?>
<!DOCTYPE html>
   <html>
       <head>
           <style type="text/css">
       <?php   if (isset($_POST['controlF']) && isset($_POST['fontS']) && isset($_POST['color'])) {
       $controlT=$_POST['controlF'];
       $_SESSION["fontControl"]=$_POST['fontS'];
       $_SESSION["colorControl"]=$_POST['color'];
       if (!isset($_POST['visible'])) {
           $_SESSION["elemVisible"]='none';
       } } ?>
               body {
                   text-align: center;
                   <?php
                       if ($controlT == 'backG') { ?>
                           background: <?php echo $_SESSION["colorControl"]; ?>
                           font-size: <?php echo $_SESSION["fontControl"].'px'; ?>
                       <?php }else { ?>
                           background: #ffffff;
                       <?php } ?>
               }
               .text {
                   <?php
                       if ($controlT == 'inputText') { ?>
                           color: <?php echo $_SESSION["colorControl"]; ?>
                           font-size: <?php echo $_SESSION["fontControl"].'px'; ?>
                           <?php if ($_SESSION["elemtVisible"] == 'none') {
                               echo 'display: none;';
                           } else { ?>
                               color: #000000;
                       <?php } } ?>
               }
               .login {
                   <?php
                       if ($controlT == 'logIn') { ?>
                           background-color: <?php echo $_SESSION["colorControl"]; ?>
                           font-size: <?php echo $_SESSION["fontControl"].'px'; ?>
                           <?php if ($_SESSION["elemtVisible"] == 'none') {
                               echo 'display: none;';
                       } } ?>
               }
               </style>
           </head>
       <body>
           <?php echo $controlT; ?>
           <h1 class="text"> Sign In</h1> </br></br>
           <label class="text"> Username </label></br>
           <input name="client_username" size="25" placeholder="Username..." /></label></br></br>
               <label class="text">Password </br> <label>
           <input name="client_password" type="password" id="client_password" placeholder="********" /></br></br>
           <input class="login" type="submit" value="Log In" />
   </body>
</html>

Thank you!!

Solutions

Expert Solution

I have rectified the problem its working

process.php

<?php
   session_start(); ?>
<!DOCTYPE html>
   <html>
       <head>
           <style type="text/css">
       <?php   if (isset($_POST['controlF']) && isset($_POST['fontS']) && isset($_POST['color'])) {
     
       $controlT=$_POST['controlF'];
       $_SESSION["fontControl"]=$_POST['fontS'];
       $_SESSION["colorControl"]=$_POST['color'];
       if (!isset($_POST['visible'])) {
           $_SESSION["elemVisible"]='none';
       } } ?>
               body {
                   text-align: center;
                 
<?php
                       if ($controlT == 'backG') { ?>
                           background: <?php echo $_SESSION["colorControl"]; ?>;
                           font-size: <?php echo $_SESSION["fontControl"].'px'; ?>;
                       <?php }else { ?>
                           background: #ffffff;
                       <?php } ?>
               }
               .text {
                   <?php
                       if ($controlT == 'inputText') { ?>
                           color: <?php echo $_SESSION["colorControl"]; ?>;
                           font-size: <?php echo $_SESSION["fontControl"].'px'; ?>;
                           <?php if ($_SESSION["elemtVisible"] == 'none') {
                               echo 'display: none;';
                           } else { ?>
                               color: #000000;
                       <?php } } ?>
               }
               .login {
                   <?php
                   
                       if ($controlT == 'logIn') { ?>
                           background-color: <?php echo$_SESSION["colorControl"];?>;
                           font-size: <?php echo $_SESSION["fontControl"].'px'; ?>;
                           <?php if ($_SESSION["elemtVisible"] == 'none') {
                               echo 'display: none;';
                       } } ?>
               }
               </style>
           </head>
       <body>
           <?php echo $controlT ?>
           <h1 class="text"> Sign In</h1> </br></br>
           <label class="text"> Username </label></br>
           <input name="client_username" size="25" placeholder="Username..." /></label></br></br>
               <label class="text">Password </br> <label>
           <input name="client_password" type="password" id="client_password" placeholder="********" /></br></br>
           <input class="login" type="submit" value="Log In" />
   </body>
</html>

Output


Related Solutions

Left shift. I am trying to left shift a string located in a text file. I...
Left shift. I am trying to left shift a string located in a text file. I am using c++ and the goal is to left shift by 1 character a string of length N, and output on stdout all of the performed shifts. Can someone tell me what I am doing wrong, and tell me what I can fix? i.e: text file contains: Hi there!. Output on stdout: Hi there!, i there!H, _there!Hi, there!Hi_,...., !Hi_there. #here "_" represent space. -------------------------------------------------------------------------------------------------------------------------...
Hi I am having the following problem. At the moment I am trying to create a...
Hi I am having the following problem. At the moment I am trying to create a bode plot for the following function. G(s)=(Ks+3)/((s+2)(s+3)) Note: Not K(s+2)! I then want to plot multiple bode plots for various values of K. Eg. 1,2,3, etc. I am having two separate issues. 1. How do I define the TF with a constant K in the location required (a multiple of s in the numerator) 2. How do I create multiple bode plots for values...
I am trying to model a system in which cubes of about 2 cm in size...
I am trying to model a system in which cubes of about 2 cm in size are floating in a circular water thank of about 30 cm in diameter. The cubes move around under the influence of the fluid flow induced by four inlets that point toward the center of the tank, and are located at the positions 0, ?/2, ?, and 3?/2. The flow velocity ranges from 0 to 10 cm/s, with an average velocity around 6 cm/s. My...
Hi! I am trying to compare 2 files, and figure out which lines from infile2 are...
Hi! I am trying to compare 2 files, and figure out which lines from infile2 are also in infile1, and output the line index, from infile2, of common lines. I would also want to see which lines (actual string line) are common. Below is my c++ program, and I am not sure what I am doing wrong. Can someone tell me what I am doing wrong and how it can be fixed? _________________________________________________________main.cpp #include<iostream> #include<fstream> #include<vector> #include<string> using namespace std;...
I am trying to write a UDP socket program in which there is a server program...
I am trying to write a UDP socket program in which there is a server program and a client program. This is what I have but I can't figure out where I am going wrong. This is the input and expected output: > gcc udpclient.c –o clientout > gcc udpserver.c –o serverout > ./serverout 52007 ‘to celebrate’ & > ./clientout odin 52007 ‘Today is a good day’ Today is a good day to celebrate //UDP echo client program #include #include...
this is my code in python I am trying to open a file and then print...
this is my code in python I am trying to open a file and then print the contents on my console but when i run it nothing prints in the console def file_to_dictionary(rosterFile): myDictionary={}    with open(rosterFile,'r') as f: for line in f: myDictionary.append(line.strip()) print(myDictionary)             return myDictionary    file_to_dictionary((f"../data/Roster.txt"))      
Hi there I need to write an ethic issue in technology but I am struggling to...
Hi there I need to write an ethic issue in technology but I am struggling to choose a topic. I am asking about the possibility of "Ethical issues" topics that is tread common in technology. Would anyone can give me some options to choose from. Thank you.
Hi, I am having trouble with trying to calculate asymptotic time complexity for each of these...
Hi, I am having trouble with trying to calculate asymptotic time complexity for each of these functions. A step by step tutorial would be great. This is done in Python. Please not only the answer, but how you calculated it as well. Here is the code #Q2 # to denote ayymptotic time complexity use the following notation # O(l) O(m) O(a) O(b) # e.g. traversing through l = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] is O(l)...
I am trying to make a program in Python that opens a file and tells you...
I am trying to make a program in Python that opens a file and tells you how many lines, vowels, consonants, and digits there are in the file. I got the print out of lines, digits, and consonants, but the if statement I made with the vowels list isn't recognizing them. How can I make the vowels go through the if statement with the list? Am I using the wrong operator? Here is my program #Assignment Ch7-1 #This program takes...
I am trying to create a program that reads from a csv file and finds the...
I am trying to create a program that reads from a csv file and finds the sum of total volume in liters of liquor sold from the csv file by county and print that list out by county in descending order. Currently my program runs and gives me the right answers but it is not in descending order. I tried this:     for county, volume in sorted(sums_by_volume.items(), key=lambda x: x[1], reverse=True):         index +=1         print("{}. {} {:.2f}".format(county, sums_by_volume[county]))      When I run...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT