Hey

I want to do something like this:

<script language="javascript">
                function calculatesha()
               {
               var name = document.getElementById("firstname").value;
               var last = document.getElementById("lastname").value;
               var complete = name+last;
               var hash = <?php echo(sha1(?>complete<?php));?>; 
               }
</script>

I hope the code is understood even if it is wrong.

Thanks.

You can only do this if you perform an AJAX call from Javascript to PHP. You can stick to Javascript, if you use an encryption package.

You can only do this if you perform an AJAX call from Javascript to PHP. You can stick to Javascript, if you use an encryption package.

I hate AJAX so I got a JS library and I am doing it with that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.