【发布时间】:2016-03-22 02:07:28
【问题描述】:
我知道这个问题已经问过很多了,但是,我太新手了,无法掌握其他线程的一般要点;因此我问了我自己的问题,该问题特定于我自己的代码。
我想通过外部 CSS 设置我的 PHP 表单在用户提交表单后为用户提供的文本样式,无论是文本样式、背景、布局等。
我目前的 PHP 是这样的:
<?php
// pull out the values from the request stream sent by the form
// and store those values into memory variables
$email = $_REQUEST['email'];
$webmail = $_REQUEST['subject'];
$firstName = $_REQUEST['Firstname'];
$lastName = $_REQUEST['Lastname'];
$sex = $_REQUEST['sex'];
$to = 'emailaddress@me.com';
$comment =$_REQUEST['comment'];
$subject =$_REQUEST['subject'];
$header = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"';
$header .= ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
$htmlhead = '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">';
$htmlhead .= '<head><title>Getting Student Info</title>';
$htmlhead .= '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>';
$htmlbody = '<body>';
// use the variables that store the information sent from the form.
mail($to, $subject,"You have received the following feedback:". $comment, "from " . $firstName . " " . $lastName, "From: $email");
$htmlbody .= '<div class="formSubmissionText">';
$htmlbody .= "<h1>Processing a form</h1>";
$htmlbody .= "<p>Thank you " . $firstName . " " . $lastName;
$htmlbody .= ". We've recieved an email from your email address: " . $email . ", and will be respond as soon as possible!</p>";
$htmlbody .= "</div></body></html>";
// use echo to write all the information out back to the browser
echo $header . $htmlhead . $htmlbody;
?>
【问题讨论】:
-
您还没有准确描述您的问题是什么?运行代码时会发生什么?输出和你的目标有什么区别?
-
我很感激您的回复,但由于我缺乏知识并且我目前“正在努力”,我不太明白这意味着什么,抱歉:/
-
我希望能够连接我用于表单所在网站的外部样式表之一。但我不确定该怎么做。对于可能造成的混乱,我深表歉意。
标签: php html css forms styling