bonjour,
i have no answer from french social forum so i come to this international forum :
i have a captcha.php (works well) :
<?php
session_start();
$_SESSION['captcha'] = mt_rand(1000,9999);
$[/contents/391-fichier-img img] = imagecreate(65,35);
$font = 'fonts/OldeEnglish.ttf';
$bg = imagecolorallocate($img, 0, 255, 255);
$textcolor = imagecolorallocate($img, 255, 0, 0);
imagettftext($img, 23, 0, 3, 30, $textcolor, $font, $_SESSION['captcha']);
header('Content-type:image/jpeg');
imagejpeg($img);
imagedestroy($img);
?>
a index.php with a classic input form action :
<FORM ACTION="mysite/index1.php">
<input type="button" value=" i know what you means , i accept this regulation !" style="width: 11.99cm; height: 1cm" onclick="window.open('mysite/index1.php', 'exemple', 'height=900, width=1000, top=90, left=350, toolbar=no, menubar=no, location=yes, resizable=yes, scrollbars=yes, status=no');">
</div>
<form action="../../../../Documents/indexredirect.php">
<div align="center">
<input type="button" value="don't be curious REFUSE now" style="width: 10.99cm; height: 2cm" onclick="window.open('google.com', 'exemple', 'height=600, width=800, top=90, left=350, toolbar=no, menubar=no, location=yes, resizable=yes, scrollbars=yes, status=no');">
</div>
</form>
the captcha condition (work well too) :
<?php
session_start();
if(isset($_POST['captcha'])) {
if($_POST['captcha'] == $_SESSION['captcha']) {
echo "captch valide !";
} else {
echo "captcha invalide ... !";
}
}
?>
<form method ="POST">
<img src="captcha.php" />
<input type="text" name="captcha" />
<input type="submit" />
</form>
My problem is how integrated for validated captch AND validated this input form action for go in index1.php safely ?
my knowledge in php is limited , so thanks for a simple answer asap
mr t.c
i have no answer from french social forum so i come to this international forum :
i have a captcha.php (works well) :
<?php
session_start();
$_SESSION['captcha'] = mt_rand(1000,9999);
$[/contents/391-fichier-img img] = imagecreate(65,35);
$font = 'fonts/OldeEnglish.ttf';
$bg = imagecolorallocate($img, 0, 255, 255);
$textcolor = imagecolorallocate($img, 255, 0, 0);
imagettftext($img, 23, 0, 3, 30, $textcolor, $font, $_SESSION['captcha']);
header('Content-type:image/jpeg');
imagejpeg($img);
imagedestroy($img);
?>
a index.php with a classic input form action :
<FORM ACTION="mysite/index1.php">
<input type="button" value=" i know what you means , i accept this regulation !" style="width: 11.99cm; height: 1cm" onclick="window.open('mysite/index1.php', 'exemple', 'height=900, width=1000, top=90, left=350, toolbar=no, menubar=no, location=yes, resizable=yes, scrollbars=yes, status=no');">
</div>
<form action="../../../../Documents/indexredirect.php">
<div align="center">
<input type="button" value="don't be curious REFUSE now" style="width: 10.99cm; height: 2cm" onclick="window.open('google.com', 'exemple', 'height=600, width=800, top=90, left=350, toolbar=no, menubar=no, location=yes, resizable=yes, scrollbars=yes, status=no');">
</div>
</form>
the captcha condition (work well too) :
<?php
session_start();
if(isset($_POST['captcha'])) {
if($_POST['captcha'] == $_SESSION['captcha']) {
echo "captch valide !";
} else {
echo "captcha invalide ... !";
}
}
?>
<form method ="POST">
<img src="captcha.php" />
<input type="text" name="captcha" />
<input type="submit" />
</form>
My problem is how integrated for validated captch AND validated this input form action for go in index1.php safely ?
my knowledge in php is limited , so thanks for a simple answer asap
mr t.c
Last edited by a moderator: