The information feedback form produced by Empire CMS can be divided into the following 4 steps: 1. Create the feedback form and form fields; 2. Set the submission address; 3. Process the feedback information; 4. Configure the feedback page.
How to provide information feedback to Empire CMS?
Step one: Create a feedback form
Create form fields in the form content, including:
Step 2: Set submission address
<code class="html"><form action="{$dedeurl}/post.php" method="post"> <!--表单字段--> </form></code>
{$dedeurl}
is the website address variable provided by Empire CMS. Step 3: Process feedback information
post.php
file, add the following code to process feedback information :<code class="php">// 接收反馈信息 $name = $_POST['name']; $contact = $_POST['contact']; $content = $_POST['content']; // 验证表单 if (empty($name) || empty($contact) || empty($content)) { echo '请填写所有必填字段!'; exit; } // 保存反馈信息到数据库 $sql = "INSERT INTO `dede_feedback` (`name`, `contact`, `content`) VALUES ('$name', '$contact', '$content')"; $res = $db->query($sql); if ($res) { echo '您的反馈已成功提交!'; } else { echo '提交失败,请稍后再试!'; }</code>
Step 4: Configure the feedback page
After completing the above steps, your website will have a feedback form for users to submit feedback.
The above is the detailed content of How to provide information feedback in Empire CMS. For more information, please follow other related articles on the PHP Chinese website!