All pastes #808778 Raw Edit

CSS Gen

public text v1 · immutable
·published 2007-12-07 22:18 UTC
rendered paste body
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>CSS gen</title>
</head>

<body>

<form action="" method="post">
Body: <br /><br />
Background color: <input type="text" name="bgc" /><br />
Font color: <input type="text" name="fc" /><br />
<input type="submit" name="submit" value="submit" />
</form>
<br /><br />
For an external style sheet:
<br /><br />
<?php
if(isset($_POST['submit'])){
$bgc = $_POST['bgc'];
$fc = $_POST['fc'];
echo "body{<br />background-color:";
echo $bgc;
echo ";<br/ >color: ";
echo $fc;
echo ";<br />}";
}
?>
<br /><br />
And for internal style sheets:
<br /><br />
<?php
if(isset($_POST['submit'])){
$bgc = $_POST['bgc'];
$fc = $_POST['fc'];
echo "&lt;style&gt;<br />body{<br />background-color: ";
echo $bgc;
echo ";<br/ >color: ";
echo $fc;
echo ";<br />}<br />";
echo "&lt;/style&gt;";
}
?>

</body>
</html>