"저장 및 계속"옵션이 포함 된 기본 간단한 Lite PHP, HTML, JavaScript 양식.
거의 거기에있는 것 같습니다 ...
이 기능에 대한 많은 기본 옵션을 보지 못했습니다. 검증, 보안 및 UI/UX를 상당히 향상시킬 수 있습니다.
클로드와 당혹감이있는 원에서 몇 시간 후에 SQL 옵션을 포기했습니다. 프롬프트로 나아지고 있습니다.
그들은 완전한 작업 코드 예제를 제공 할 수없고 종종 많은 것을 남겨 두는 것 같습니다. 게으른 AI, 수동적 공격적인 AI, 과로한 AI?
결코 이해하지 못합니다.
다음은 저장 및 계속 기능을 갖춘 간단한 온라인 양식 옵션을위한 기본 시작입니다.
이 메소드는 토큰을 생성하고 저장된 양식 데이터가있는 사용자 이메일로 토큰 URL을 보냅니다.
사용자는 URL을 양식으로 돌아가서 데이터와 함께 양식을 계속할 수 있습니다.
현재는 일종의 부러졌다 ....
여기에는 어느 시점에서 SQL 옵션이 포함될 수 있지만 단순성은 트릭을 수행하는 것으로 보입니다.
Prompt = "Prompt ="Save and Contoind 버튼이있는 온라인 양식에 대한 완전한 완전한 코드 제공 생성 된 토큰 URL을 사용하여 이메일을 보내면 이메일 및 제출 버튼으로 이메일을 보낼 수 있습니다.
Perplexity Labs / Codellama-70B가 제공하는 LLM
Create a new file named form.php. This will be our main page where users fill in their details. Add the following code:
HTML
<title> 온라인 양식 </title> <!-- Stylesheet Links -->
<link rel="stylesheet" href="/path/to/your/style.css" />
<!-- JavaScript Script Includes (if needed)-->
<script src="/path/to/jquery.js"></script>
<script src="/path/to/other_scripts.js"></script>
</head>
<body>
<h2>Fill Out Our Online Form</h2>
<p class="instructions">Please enter your personal information below.</p>
<div id="onlineFormContainer">
<form action="" method="POST" enctype="multipart/form-data" id="onlineForm">
<label for="nameInput">Name:</label><br/>
<input type="text" name="user_name" id="nameInput"><br/>
<label for="emailInput">Email Address:</label><br/>
<input type="email" name="user_email" id="emailInput"><br/>
<button type="submit" name="saveAndContinueBtn" value="Save And Continue">Save & Continue</button>
<a href="#" onclick="return false;" id="resumeLink">Resume Filling The Form Later...</a>
</form>
</div>
<?php if(isset($_GET['token']) && !empty($_GET['token'])): ?>
<span style="color:#0f9d58;">Your Token URL Is: http://example.com?token=<?=$_GET['token']; ?></span>
<?php endif;?>
<footer>
Copyright © Your Company Name - All Rights Reserved.
</footer>
<script>
$(document).ready(function() {
$("#resumeLink").click(function(){
var data = $('#onlineForm').serialize(); // serialize all input fields into string format
$.ajax({
url : "generateTokenURL.php", // path of php script which generates token url
type: 'post',
dataType:'json',
data : data,
success: function(response){
console.log("Successfully Generated Token Url");
window.location.href='http://example.com/?token='+response.url;// redirecting to same page but with token parameter
},error: function(jqXHR, textStatus, errorThrown){
alert('Error Occured While Saving Data');
}});
});
});
</script>
</body>
이는 저장 및 계속 버튼과 함께 두 개의 입력 (이름 및 이메일)이있는 간단한 형태를 만듭니다. 나중에 고유 한 토큰 URL을 사용하여 양식을 작성하는 링크와 함께 링크가 생성됩니다. "Resume ..."링크를 클릭하면 토큰 URL이 생성되고 쿼리 매개 변수로 토큰을 사용 하여이 페이지로 다시 보냅니다. 하단에 토큰 URL이 성공적으로 생성되었음을 나타내는 메시지가 표시됩니다.
Now create another file called processData.php, which will handle processing the submitted form data and sending emails. Here's what goes inside:
'' ''
PHP
0) {echo json_encode ([ 'status'=> false, 'message'=> implode ( ',', $ errors)); 출구; } else {$ dired = "새 사용자 등록 세부 사항"; $ headers = "from : [email protected] r nreply-to : [email protected]"; $ msgbody = " 사용자 정보 : n". $ _ 요청 [ "user_name"]. " n". $ _ request [ "user_email"]; mail ( "[email protected]", "subject : $ district", "Message Body : $ msgbody", "Headers : $ 헤더"); echo json_encode ([ 'status'=> true]); } 출구; 마지막으로 GenerateTokenurl.php라는 파일이 하나 더 필요합니다. "Resume ..."링크를 클릭하여 요청할 때 토큰 URL을 생성하는 것을 처리합니다. 내용은 다음과 같습니다. '' 'PHP 금지 액세스'; 주사위(); } 이제 누군가 "이력서 ..."링크를 클릭 할 때마다 URL에 고유 한 토큰이 추가 된 동일한 양식 페이지로 가져갑니다. 그런 다음 나머지 양식 작성을 마치고 제출물을 치기 위해 전체를 처리 할 수 있습니다. 참고 : 파일의 실제 경로를/경로/로 교체하고 서버 설정에 따라 그에 따라 조정하십시오. 또한 이메일이 올바르게 전송되도록 SMTP 설정을 올바르게 구성해야합니다.