PHP - Problemas con el Captcha

 
Vista:

Problemas con el Captcha

Publicado por MIguel (1 intervención) el 29/10/2015 09:08:10
Hola amigos tengo un problema en mi web y es que no se muestra la imagen del Captcha y no consigo encontrar el fallo!! Funcionó hasta que hice una migración de la web puede venir el problema del correo???

El captcha no carga la imagen pero he puesto cualquier cosa y lo acepta, pero me devuelve un mensaje de error que dice: SMTP Error: The following recipients failed: XXXXXX

El código que estoy usando es:
CaptchaSecurityImages.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
session_start();
 
if( isset($_POST['submit'])) {
if( $_SESSION['security_code'] == $_POST['security_code'] && !empty($_SESSION['security_code'] ) ) {
// Insert you code for processing the form here, e.g emailing the submission, entering it into a database. 
echo 'Thank you. Your message said "'.$_POST['message'].'"';
unset($_SESSION['security_code']);
} else {
// Insert your code for showing an error message here
echo 'Sorry, you have provided an invalid security code';
}
} else {
?>
 
<form action="form.php" method="post">
<label for="name">Name: </label><input type="text" name="name" id="name" /><br />
<label for="email">Email: </label><input type="text" name="email" id="email" /><br />
<label for="message">Message: </label><textarea rows="5" cols="30" name="message" id="message"></textarea><br />
<img src="CaptchaSecurityImages.php?width=100&height=40 &characters=5" /><br />
<label for="security_code">Security Code: </label><input id="security_code" name="security_code" type="text" /><br />
<input type="submit" name="submit" value="Submit" />
</form>
 
<?php
}
?>

Form.PHP

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
session_start();
 
if( isset($_POST['submit'])) {
if( $_SESSION['security_code'] == $_POST['security_code'] && !empty($_SESSION['security_code'] ) ) {
// Insert you code for processing the form here, e.g emailing the submission, entering it into a database. 
echo 'Thank you. Your message said "'.$_POST['message'].'"';
unset($_SESSION['security_code']);
} else {
// Insert your code for showing an error message here
echo 'Sorry, you have provided an invalid security code';
}
} else {
?>
 
<form action="form.php" method="post">
<label for="name">Name: </label><input type="text" name="name" id="name" /><br />
<label for="email">Email: </label><input type="text" name="email" id="email" /><br />
<label for="message">Message: </label><textarea rows="5" cols="30" name="message" id="message"></textarea><br />
<img src="CaptchaSecurityImages.php?width=100&height=40 &characters=5" /><br />
<label for="security_code">Security Code: </label><input id="security_code" name="security_code" type="text" /><br />
<input type="submit" name="submit" value="Submit" />
</form>
 
<?php
}
?>

Mas el archivo Monofont.ttf
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder