|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Dubz Smarty n00b
Joined: 18 Feb 2012 Posts: 1
|
Posted: Sat Feb 18, 2012 9:59 pm Post subject: creating a randomly generated hash |
|
|
I have a website I'm building off of that is running with smarty. One thing I need right now is a random encryption hash. I'm not sure how to do this in smarty so I'll give you a look at the original code:
Code: |
<script>
function addCode() {
var randId = Math.floor(Math.random()*1000);
$("#codesTable").find('tbody')
.append($('<tr>').attr('id',randId).html('<td><a href="" class="deleteButton" rel="'+randId+'"><img src="Images/Icons/delete.png" /></a></td><td><input type="text" name="codes[]" value="'+randId+'" size="40"/></td>'));
$('#codesForm .deleteButton').unbind();
$('#codesForm .deleteButton').click(function () {
deleteTR($(this).attr('rel'));
return false;
});
}
</script>
|
What I need to do is change the first line of the function to a php type generation. What I was planning on using was "sha1(md5(time()))" but I'm not sure how to accomplish this with smarty. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|