0
좋아요, 그래서 내 보안 문자 시스템을 만들려고합니다. 두 페이지, 양식 페이지 및 양식 작업이 있습니다. 다음PHP 보안 문자 시스템
<html>
<head>
<title>Captcha</title>
<center>
<form method="POST" action="captcha.php">
<label>Entered Text: </label><input type="text" name="captcha">
<input type="submit" name="submit" value="Submit Captcha!">
</form>
</center>
</head>
</html>
<?php
$firstdigit = rand(1, 9);
$seconddigit = rand(27, 105);
$lastdigit = rand(1050, 9515);
$middle = rand(1000, 20000);
$captcha = "<b><center><font face=\"Arial\">AX-$firstdigit-X-$seconddigit-K3I$middle-AN3Z-$lastdigit</font></center></b>";
echo "$captcha";
?>
및 다음 : 여기 내 코드입니다
<?php
$captcha2 = $_POST['captcha']; //This is the input field
$submit = $_POST['submit']; //This is Submit
if ($submit) {
if ($captcha2) {
echo "Everything is good."; //Echo'd if everything is good
} else {
echo "Please fill in all fields."; //Echo'd if $captcha isn't filled out
}
} else {
echo "Direct access not allowed. Please click submit."; //Echo'd if submit is not pressed, and they access this directly.
}
?>
이 어떻게 다른 폼에서 $의 보안 문자 변수를 타고 captcha.php 페이지에 넣을 수 있습니까? 나는 $의 보안 문자 하나에 넣어 많은 변수를 가지고 생각, 그래서
이 http://pastebin.com/tnviYStW를 시도했는데 작동하지 않습니다. – user1631702
$ _SESSION 변수를 사용하는 모든 스크립트에서'session_start()'를 사용해야합니다. – Peter
나는이 pastebin.com/tnviYStW를 시도했고, – user1631702