0
양식을 작성하려고합니다. PHP 양식 관련 문제
나는 누군가가 정보를 기입 한 후, 그들은 (지금 그들이 입력 한 내용의 PHP 페이지로 이동) 제출 에 대한 감사합니다를 볼 수 아래 가서t1.html 정보 을 작성하려면
누군가가 양식에서 입력 한 내용이있는 PHP 페이지의 링크와 함께 전자 메일 (양식에있는 전자 메일 주소)을 받게됩니다.
이메일을받은 사람은 해당 PHP 페이지를 수락하거나 거부합니다.
PHP 페이지를 생성하는 방법이 누락되어 이메일을받은 사람이 양식에 입력 된 정보에 액세스 할 수 있습니다. 어떻게해야합니까?
형태
<form name="iform" method="post" action="html_form1.php" class="iform">
<ul>
<li><label for="SendingeWarrant">Sending to:</label><input class="itext" type="text" name="SendingeWarrant" id="SendingeWarrant" /></li>
<li class="iseparator"> </li>
<li>
<label for="Email">Email Address that the email goes to:</label><input class="itext" type="text" name="Email" id="Email" />
</li>
<li class="iseparator"> </li>
<li><label> </label><input type="Submit" name="Submit" value="Submit" /></li>
</ul></form>
PHP
<?php
if (!empty($_POST)) {
$success = $error = false;
$post = new stdClass;
foreach ($_POST as $key => $val)
$post->$key = trim(strip_tags($_POST[$key]));
// Check for blank fields
if (empty($post->Email))
$error = true;
else {
// Get this directory, to include other files from
$dir = dirname(__FILE__);
// Get the contents of the pdf into a variable for later
ob_start();
require_once($dir.'/pdf.php');
$pdf_html = ob_get_contents();
ob_end_clean();
// Load the dompdf files
require_once($dir.'/dompdf/dompdf_config.inc.php');
$dompdf = new DOMPDF(); // Create new instance of dompdf
$dompdf->load_html($pdf_html); // Load the html
$dompdf->render(); // Parse the html, convert to PDF
$pdf_content = $dompdf->output(); // Put contents of pdf into variable for later
// Get the contents of the HTML email into a variable for later
ob_start();
require_once($dir.'/html3.php');
$html_message = ob_get_contents();
ob_end_clean();
// Load the SwiftMailer files
require_once($dir.'/swift/swift_required.php');
$mailer = new Swift_Mailer(new Swift_MailTransport()); // Create new instance of SwiftMailer
$message = Swift_Message::newInstance()
->setSubject('eWarrant') // Message subject
->setTo(array($post->Email => $post- >SendingeWarrant)) // Array of people to send to
->setFrom(array('[email protected]' => 'eWarrant')) // From:
->setBody($html_message, 'text/html'); // Attach that HTML message from earlier
// Send the email, and show user message
if ($mailer->send($message))
$success = true;
else
$error = true;
}
}
?>
<html>
<head>
<style>
body {font-family:Helvetica, Arial, sans-serif; font-size:10pt;}
table {width:100%; border-collapse:collapse; border:1px solid #CCC;}
td {padding:5px; border:1px solid #CCC; border-width:1px 0;}
</style>
</head>
<body>
<h1></h1>
<table>
<tr>
<td><strong>Name of person sending to:</strong></td>
<td><?php echo $_POST["SendingeWarrant"]; ?></td>
<td><strong>Email being sent to:</strong></td>
<td><?php echo $_POST["Email"]; ?></td>
</tr>
</table>
<p>Approve/Deny</p>
</body>
</html>
</body>
</html>
이메일 PHP 파일
<html>
<body>
<p style="font-family:Helvetica, Arial, sans-serif;font-size:"x-small";"><?php echo $post->SendingeWarrant; ?></p>
<p style="font-family:Helvetica, Arial, sans-serif;font-size:"x-small";">Click link to approve or deny: </p>
</body>
</html>
SQL에 대해 들어 봤어? – enapupe
들어 본 적이 있지만 익숙하지 않다 – user2197436
반드시 SQL을 사용하십시오. –