JavaScript Captcha php … I dont know what is error

I am new in php and i want to do capthca ... I wrote the code, validation etc , and as a result i get only small picture ... and nothing on it ... and my program dont tell me where is an error

This is my code in captcha.php:

<?php
session_start();`enter code here`


  // build the base captcha image 

$img = imagecreatetruecolor(80,30);

$white = imagecolorallocate($img, 255, 255, 255);
$black = imagecolorallocate($img, 0, 0, 0);
$grey = imagecolorallocate($img,150,150,150);
$red = imagecolorallocate($img, 255, 0, 0);
$pink = imagecolorallocate($img, 200, 0, 150);

// build the base captcha image - END

// building randomString 
function randomString($length){
    $chars = "abcdefghijkmnopqrstuvwxyz023456789";
    srand((double)microtime()*1000000);
    $str = "";
    $i = 0;

        while($i <= $length){
            $num = rand() % 33;
            $tmp = substr($chars, $num, 1);
            $str = $str . $tmp;
            $i++;
        }
    return $str;
}

for($i=1;$i<=rand(1,5);$i++){
    $color = (rand(1,2) == 1) ? $pink : $red;
    imageline($img,rand(5,70),rand(5,20), rand(5,70)+5,rand(5,20)+5, $color);
}
// building randomString - END

// fill  image with a white rectangle
imagefill($img, 0, 0, $white);

$string = randomString(rand(7,10));
$_SESSION['string'] = $string;

imagettftext($img, 11, 0, 10, 20, $black, "calibri.ttf", $string);
// fill  image with a white rectangle - END

//  type of image
header("Content-type: image/png");
imagepng($img);


?>

And this is my code in contact.php:

<?php

session_start();

if(isset($_POST['submit'])) {

    if(!empty($_POST['ime']) && !empty($_POST['email']) && !empty($_POST['poruka']) && !empty($_POST['code'])) {

        if($_POST['code'] == $_SESSION['rand_code']) {

            // send email
            $accept = "Poruka uspesno poslata.";

        } else {

            $error = "Pogresan kod.";
              }

    } else {

        $error = "Molimo Vas popunite sva polja.";    
    }
 }

?> 

<!DOCTYPE html >
<html >
<head>
<title>Kontaktirajte nas</title>

</head>

<body>

<?php if(!empty($error)) echo '<div class="error">'.$error.'</div>'; ?>
<?php if(!empty($accept)) echo '<div class="accept">'.$accept.'</div>'; ?>

<form  method="post">
    <p>Ime<input type="text" name="ime" /></p>
    <p>Email<input type="text" name="email" /></p>
    <p>Poruka<textarea name="poruka" rows=”25” cols=”40”></textarea></p>
        <img src="captcha.php"/>
    <p>Posalji<input type="text" name="code" /></p>
    <p><input type="submit" name="submit" value="Posalji" class="button" /></p>
    <p>"IPO" MASARIKOVA br.5, BEOGRAD</p>
</form>

</body>
</html>
Answer:1

In our system we have so far been using Keycloak 3.4.3 and the Script Authenticator authentication provider functionality as part of the browser based authentication. Now, after upgrading to Keycloak ...

In our system we have so far been using Keycloak 3.4.3 and the Script Authenticator authentication provider functionality as part of the browser based authentication. Now, after upgrading to Keycloak ...

  1. keycloak script authenticator
  2. keycloak script authenticator example
  3. keycloak script authenticator missing
  4. keycloak script authentication flow
  5. keycloak enable script authenticator
  6. keycloak script based authenticator
  7. keycloak script based authentication

I have a list of the simple objects (containing only names) in my model: var list = [{name: "Jane"}, {name: "Mary"}]; Here I display them: <table> <tr data-ng-repeat="pers in list | filter:...

I have a list of the simple objects (containing only names) in my model: var list = [{name: "Jane"}, {name: "Mary"}]; Here I display them: <table> <tr data-ng-repeat="pers in list | filter:...

  1. angularjs directive with parameters
  2. angularjs directive with controller
  3. angularjs directive with template
  4. angularjs directive with ng-model
  5. angularjs directive with typescript
  6. angularjs directive with controller and link
  7. angularjs directive with attribute
  8. angularjs directive with html template
  9. angularjs directive with scope
  10. angularjs directive with templateurl
  11. angularjs directive with input
  12. angularjs directive with dynamic template
  13. angularjs directive with params
  14. angularjs directive with arguments
  15. angularjs directive with service
  16. angularjs directive with controller example
  17. angularjs directive with value
  18. angularjs directive with css
  19. angularjs directive with ng-repeat
  20. angularjs directive with function

I have this simple class : class myCustomClass{ foo(value){ //do some stuff } faa(){ //do some stuff $.getJSON( someUrl, function(data) { // how ...

I have this simple class : class myCustomClass{ foo(value){ //do some stuff } faa(){ //do some stuff $.getJSON( someUrl, function(data) { // how ...

  1. javascript from ajax response
  2. javascript ajax from json
  3. execute javascript from ajax response jquery
  4. execute javascript from ajax response
  5. javascript return from ajax
  6. call javascript from ajax
  7. load javascript from ajax
  8. javascript array from ajax
  9. javascript variable from ajax
  10. javascript validation from ajax
  11. javascript pdf from ajax
  12. jquery javascript from ajax
  13. javascript ajax
  14. javascript ajax post
  15. javascript ajax request
  16. javascript ajax example
  17. javascript ajax get
  18. javascript ajax post json
  19. javascript ajax file upload example
  20. javascript ajax get json

I have an Angular app used to track hours worked by the user. When the user adds a new job, they are taken through a wizard, with each page/controller adding a new property to the job object. Once the ...

I have an Angular app used to track hours worked by the user. When the user adds a new job, they are taken through a wizard, with each page/controller adding a new property to the job object. Once the ...

  1. redirect from within iframe
  2. redirect page from within iframe
  3. redirect within html
  4. redirect within wordpress
  5. redirect with url
  6. redirect within page
  7. redirect within bash script
  8. redirect within frame
  9. redirect within website
  10. redirect within shopify
  11. redirect within virtual host
  12. redirect with router
  13. redirect within
  14. redirect parent page from within iframe
  15. redirect with web.config