Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP&;CSS输出问题_Php_Css - Fatal编程技术网

PHP&;CSS输出问题

PHP&;CSS输出问题,php,css,Php,Css,我如何设置它以便可以操纵$backgroundcolor=“#00FFFF”; 在另一个.php文件上 最初,我只想更改$backgroundcolor=“#00FFFF”的值; 根据用户输入,从另一个表单返回到此表单(style.php) 我在这个表单上尝试了这一点,希望能给$backgroundcolor不同的值: $backgroundcolor=“” 然后,我使用另一个.php表单调用$backgroundcolor=“没有结果的不同十六进制颜色” 事实上,我看到的只是值#0033FF的

我如何设置它以便可以操纵$backgroundcolor=“#00FFFF”; 在另一个.php文件上

最初,我只想更改$backgroundcolor=“#00FFFF”的值; 根据用户输入,从另一个表单返回到此表单(style.php)

我在这个表单上尝试了这一点,希望能给$backgroundcolor不同的值: $backgroundcolor=“”

然后,我使用另一个.php表单调用$backgroundcolor=“没有结果的不同十六进制颜色”

事实上,我看到的只是值#0033FF的输出,但我不想要输出,我想要新值#0033FF 作为背景色

<?php header("Content-type: text/css"); 
$backgroundcolor = "#00FFFF ";
$textcolor = " #0033FF";
?>
body {
 background:<?php  echo $backgroundcolor?>;
 color:<?php echo $textcolor?>;
}

身体{
背景:;
颜色:;
}
您可以使用

您试图做的是通过请求持久化一些数据

您必须在方便的地方存储背景和文本颜色。

您可以使用

您试图做的是通过请求持久化一些数据


您必须在方便的地方存储背景和文本颜色。

在php端使用此选项:

我们的想法是将所有css和php代码设置如下:

<select name = "backgroundcolor">
<option value = "#000000">Black</option>
<!-- And all we have to do is add multiple options for the different color values      
and the php script will do the rest after the user has selected 
the color he or she wants, done-->


#heredoc
$theStyle = <<<HERE
"border-width:$borderSize$sizeType;
background-color:$backgroundcolor;
color:$fontcolor;
border-style:$borderStyle;
border-color:green"
HERE;
$backgroundcolor=$_请求[“backgroundcolor”]

背景色:$backgroundcolor

Where background color:将为您提供传统CSS中的背景颜色,我们将使用一个变量,在本例中为$backgroundcolor

在html方面,我们将有如下表单:

<select name = "backgroundcolor">
<option value = "#000000">Black</option>
<!-- And all we have to do is add multiple options for the different color values      
and the php script will do the rest after the user has selected 
the color he or she wants, done-->


#heredoc
$theStyle = <<<HERE
"border-width:$borderSize$sizeType;
background-color:$backgroundcolor;
color:$fontcolor;
border-style:$borderStyle;
border-color:green"
HERE;

黑色
#埃雷多克

$theStyle=在php端使用此选项:

我们的想法是将所有css和php代码设置如下:

<select name = "backgroundcolor">
<option value = "#000000">Black</option>
<!-- And all we have to do is add multiple options for the different color values      
and the php script will do the rest after the user has selected 
the color he or she wants, done-->


#heredoc
$theStyle = <<<HERE
"border-width:$borderSize$sizeType;
background-color:$backgroundcolor;
color:$fontcolor;
border-style:$borderStyle;
border-color:green"
HERE;
$backgroundcolor=$_请求[“backgroundcolor”]

背景色:$backgroundcolor

Where background color:将为您提供传统CSS中的背景颜色,我们将使用一个变量,在本例中为$backgroundcolor

在html方面,我们将有如下表单:

<select name = "backgroundcolor">
<option value = "#000000">Black</option>
<!-- And all we have to do is add multiple options for the different color values      
and the php script will do the rest after the user has selected 
the color he or she wants, done-->


#heredoc
$theStyle = <<<HERE
"border-width:$borderSize$sizeType;
background-color:$backgroundcolor;
color:$fontcolor;
border-style:$borderStyle;
border-color:green"
HERE;

黑色
#埃雷多克

$theStyle=我不明白你想做什么。PHP与CSS有什么关系?在另一个php文件上操纵$backgroundcolor是什么意思?你会包括另一个php文件吗?你的解释很糟糕。请重新解释你的解释,因为这真的很难理解。我不明白你想做什么。PHP与CSS有什么关系?在另一个php文件上操纵$backgroundcolor是什么意思?你会包括另一个php文件吗?你的解释很糟糕。请重新解释一下你的解释,因为它真的很难理解。。。。然后在另一个脚本中重新设置。。。。然后在另一个脚本中重新设置它。