nigelschal
Gebruiker
- Lid geworden
- 15 sep 2009
- Berichten
- 9
ik heb een vraagje, is het mogelijk in captcha dat je bijvoorbeeld op de achtergrond een watermerk of plaatje zet , bijvoorbeeld van je bedrijf.
Bekijk de onderstaande video om te zien hoe je onze site als een web app op je startscherm installeert.
Opmerking: Deze functie is mogelijk niet beschikbaar in sommige browsers.
<?php
session_start();
if(isset($_POST['submit'])) {
if(isset($_POST['captcha_code']) && isset($_SESSION['captcha_code'])) {
if(md5($_POST['captcha_code']) == $_SESSION['captcha_code']) {
echo 'Result: CAPTCHA code correct.<br />';
}else{
echo 'Result: CAPTCHA code incorrect.<br />';
}
}else{
if(!isset($_POST['captcha_code'])) {
echo 'Result: No security code was entered.<br />';
}
if(!isset($_SESSION['captcha_code'])) {
echo 'Result: No CAPTCHA was viewed.<br />';
}
}
}
?>
<form method="POST">
<img src="captcha.php" />
<br /><br />
Vul in precies wat hier boven staat afgebeeld. PAS OP! Hoofdletter gevoelig.<br />
<input type="text" name="captcha_code" /> <br /><br />
<table border="0">
<tr>
<td>Naam :</td><td><br /><input type="text" name="Naam2" /><br /><br /></td>
</tr>
<tr>
<td>Adress :</td><td><br /><input type="text" name="Naam3" /><br /><br /></td>
</tr>
<tr>
<td height="58">Woonplaats :</td><td><br /><input type="text" name="Naam" /><br /><br /></td>
</tr>
</table><br /><br />
Vul hier uw Commentaar in A.U.B.
<BR>
<TEXTAREA NAME="tekstvak" ROWS="4" COLS="50"></TEXTAREA><br /><br />
<input type="submit" name="submit" value="Submit" />
</form>
<?php
session_start();
$width = 250;
$height = 110;
$im = imagecreate($width, $height);
$bg = imagecolorallocate($im, 150, 150, 115);
// genereert een willekeurig getal.
$len = 5;
$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
$string = '';
for ($i = 0; $i < $len; $i++) {
$pos = rand(0, strlen($chars)-1);
$string .= $chars{$pos};
}
$_SESSION['captcha_code'] = md5($string);
// grid
$grid_color = imagecolorallocate($im, 200, 150, 85);
$number_to_loop = ceil($width / 20);
for($i = 0; $i < $number_to_loop; $i++) {
$x = ($i + 1) * 20;
imageline($im, $x, 0, $x, $height, $grid_color);
}
$number_to_loop = ceil($height / 10);
for($i = 0; $i < $number_to_loop; $i++) {
$y = ($i + 1) * 10;
imageline($im, 0, $y, $width, $y, $grid_color);
}
// random lines
$line_color = imagecolorallocate($im, 242, 173, 26);
for($i = 0; $i < 30; $i++) {
$rand_x_1 = rand(0, $width - 1);
$rand_x_2 = rand(0, $width - 1);
$rand_y_1 = rand(0, $height - 1);
$rand_y_2 = rand(0, $height - 1);
imageline($im, $rand_x_1, $rand_y_1, $rand_x_2, $rand_y_2, $line_color);
}
// write the text
$text_color = imagecolorallocate($im, 255, 255, 255);
$rand_x = rand(18, $width - 50);
$rand_y = rand(18, $height - 15);
imagestring($im, 18, $rand_x, $rand_y, $string, $text_color);
header ("Content-type: image/png");
imagepng($im);
?>
$im = imagecreate($width, $height);
$im = imagecreatefrompng('padnaarjeafbeelding'); /* bij een .png afbeelding */
$im = imagecreatefromjpeg('padnaarjeafbeelding'); /* bij een .jpeg / .jpg afbeelding */
$im = imagecreatefromgif('padnaarjeafbeelding'); /* bij een .gif afbeelding */
<?php
session_start();
$width = 250;
$height = 110;
$im = imagecreatefromgif('logo_220.gif');
$bg = imagecolorallocate($im, 150, 150, 115);
// genereert een willekeurig getal.
$len = 5;
$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
$string = '';
for ($i = 0; $i < $len; $i++) {
$pos = rand(0, strlen($chars)-1);
$string .= $chars{$pos};
}
$_SESSION['captcha_code'] = md5($string);
// grid
$grid_color = imagecolorallocate($im, 200, 150, 85);
$number_to_loop = ceil($width / 20);
for($i = 0; $i < $number_to_loop; $i++) {
$x = ($i + 1) * 20;
imageline($im, $x, 0, $x, $height, $grid_color);
}
$number_to_loop = ceil($height / 10);
for($i = 0; $i < $number_to_loop; $i++) {
$y = ($i + 1) * 10;
imageline($im, 0, $y, $width, $y, $grid_color);
}
// random lines
$line_color = imagecolorallocate($im, 242, 173, 26);
for($i = 0; $i < 30; $i++) {
$rand_x_1 = rand(0, $width - 1);
$rand_x_2 = rand(0, $width - 1);
$rand_y_1 = rand(0, $height - 1);
$rand_y_2 = rand(0, $height - 1);
imageline($im, $rand_x_1, $rand_y_1, $rand_x_2, $rand_y_2, $line_color);
}
// write the text
$text_color = imagecolorallocate($im, 255, 255, 255);
$rand_x = rand(18, $width - 50);
$rand_y = rand(18, $height - 15);
imagestring($im, 18, $rand_x, $rand_y, $string, $text_color);
header ("Content-type: image/png");
imagepng($im);
?>
<?php
session_start();
if(isset($_POST['submit'])) {
if(isset($_POST['captcha_code']) && isset($_SESSION['captcha_code'])) {
if(md5($_POST['captcha_code']) == $_SESSION['captcha_code']) {
echo 'Result: CAPTCHA code correct.<br />';
}else{
/*echo 'Result: CAPTCHA code incorrect.<br />';*/
}
}else{
if(!isset($_POST['captcha_code'])) {
echo 'Result: No security code was entered.<br />';
}
if(!isset($_SESSION['captcha_code'])) {
echo 'Result: No CAPTCHA was viewed.<br />';
}
}
}
?>
<form method="POST">
<img src="captcha.php" />
<br /><br />
Vul in precies wat hier boven staat afgebeeld. PAS OP! Hoofdletter gevoelig.<br />
<input type="text" name="captcha_code" /> <br /><br />
<table border="0">
<tr>
<td>Naam :</td><td><br /><input type="text" name="Naam2" /><br /><br /></td>
</tr>
<tr>
<td>Adress :</td><td><br /><input type="text" name="Naam3" /><br /><br /></td>
</tr>
<tr>
<td height="58">Woonplaats :</td><td><br /><input type="text" name="Naam" /><br /><br /></td>
</tr>
</table><br /><br />
Vul hier uw Commentaar in A.U.B.
<BR>
<TEXTAREA NAME="tekstvak" ROWS="4" COLS="50"></TEXTAREA><br /><br />
<input type="submit" name="submit" value="Submit" />
</form>
<?php
$im = imagecreatefromgif('logo_220.gif');
header ("Content-type: image/png");
imagepng($im);
?>
We gebruiken essentiële cookies om deze site te laten werken, en optionele cookies om de ervaring te verbeteren.