<?php
  if (isset($_GET['source'])) {
        highlight_file($_SERVER['SCRIPT_FILENAME']);
        exit;
  }
?>
<html>
<head>
<title>PHP and Web Forms</title>
    
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="theme-color" content="#B5C7DD" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="../css/reset.css">
        <link rel="stylesheet" href="../css/mandy.css">
        <link rel="stylesheet" href="../css/form.css">

<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon">
</head>
<body>
    
<h2 class="pad-top">    
    
<?php   # need this to be able to view source in the below anchor tag
  $urlPath=dirname($_SERVER['SCRIPT_URL']).'/'; 
  $labsPath=$urlPath.'labs/'; 
?>     

    <a href="../index.php">CS 130A</a> → Lab 6
<a href="<?=$urlPath?>index.php?source" target="labs">Source code</a>

</h2>   

    <section>
<h4>Color Picker</h4>
    <p class="nudge in">Anything written within these dashed lines will turn into the colors chosen below. Spaghetti is tasty. <br />Do NOT pick the same background and text color. </p>

 <form action="color.php" method=post name="render" id="render"> 
<div class="flex-column">
<div class="nudge">  

<label for="text">Text Color: </label> <br />   
    <label><input type="radio" name="text" value="red" id="red-txt" /> Red </label><br />
    <label><input type="radio" name="text" value="yellow" id="yel-txt" /> Yellow </label><br />
    <label><input type="radio" name="text" value="green" id="grn-txt" /> Green </label><br />
    <label><input type="radio" name="text" value="blue" id="blu-txt" /> Blue </label><br />
    <label><input type="radio" name="text" value="black" id="blk-txt" /> Black </label>
    
         <label class="invis"><input type="radio" name="text" value="blank" id="no-txt" checked/> None </label>
 
</div>   

<div class="nudge"> 
    
<label for="bg">Background Color: </label>    <br />
    <label><input type="radio" name="bg" value="white" id="wht-bg" /> White </label><br />
    <label><input type="radio" name="bg" value="yellow" id="yel-bg" /> Yellow </label><br />
    <label><input type="radio" name="bg" value="grey" id="gry-bg" /> Grey </label><br />
    <label><input type="radio" name="bg" value="blue" id="blu-bg" /> Blue </label><br />
    <label><input type="radio" name="bg" value="black" id="blk-bg" /> Black </label>    
    
        <label class="invis"><input type="radio" name="bg" value="na" id="no-bg" checked/> None </label>    
    
</div>
 </div>    
<div class="pad-top flex-center">     
<input type="reset" value="Reset" class="button">    
     
<input type="submit" name="submit" value="Submit" class="space button">
</div>     
      
</form>
       
</section>        
<pre>

<?php   
  
    
?>     

</pre>    
    <p class="hide">
    this is a blank paragraph to do nothing but take up space and ensure the formatting works
    </p>
    <div class="stretch"></div>
</body>
</html>