1

I'm learning php

I have a form like this

where COD and KEY are global variables

echo' <form action="" method="post">
<input type="hidden" name="id" id="'.$array['Noart'].'id" value="';
              echo  openssl_encrypt($array['Noart'],COD,KEY)'">;

and in another php file, I do this

 if(is_numeric(openssl_decrypt($_POST['id'],COD,KEY)))
      {
        $ID=openssl_decrypt($_POST['id'],COD,KEY);
        $msg.="OK ID ".$ID."<br>";
      }else{$msg.="wrong ID ".$ID;}

that works fine

but if I try to this is wrong

echo'<input style="width:80px;height:30px" class="form-control"
               type="number" name="count" id="'.$array['Noart'].'count" min="1" 
               value=" '.openssl_encrypt(.'';
               echo' '.,COD,KEY).'" max="10" >

is there a way to encrypt that value that is changing?

I have searched but can't find how to do it, someone suggested that I use javascript but I didn't know how

I will appreciate any help, thanks

Michael
  • 11
  • 2
  • I have read this twice and I still can't figure out what your problem is. Are there any error codes? – miny1997 Apr 06 '20 at 20:28
  • expected 3 arguments found 0 . I guess it's because I can't separate that function like this, using echo, how could I do it then – Michael Apr 06 '20 at 20:49
  • https://stackoverflow.com/questions/5149080/how-can-i-update-value-of-input-text-via-ajax – kmoser Apr 06 '20 at 21:10

0 Answers0