Php code is commented in html

Asked

Viewed 807 times

4

I am creating a captcha in a registration form, and I am calling the image with a php command, but the captcha image does not appear in the form, and when I enter the browser console the php code is commented.

Code in the editor looks like this:

<?php require_once('imagem_seguranca.php'); ?>

And on the console appears commented like this:

<!--<?php require_once('imagem_seguranca.php'); ?>-->

File code 'image-security.php'

<?php $imagem = mt_rand(0,4);?>
<img src="captcha.php?iu=<?php echo $imagem; ?>" />
  • Local or on remote server?

  • Can you put more code together? just this bit gives no idea what the problem might be...

  • What is the name of the file that has this part? -> <?php require_once('imagem_seguranca.php'); ?>

  • form_captcha.php

  • Make sure the extension is as .php and not .html. If you’re right, edit the question and put more details...

1 answer

2


A file that pulls another file that pulls the image...

Just do it once.

Where you want to put the captcha, do:

<img src="captcha.php?iu=<?php echo mt_rand(0,4); ?>" />

Browser other questions tagged

You are not signed in. Login or sign up in order to post.