Solved

cakephp, obfuscate,hash, form ids

Posted on 2011-03-14
3
537 Views
Last Modified: 2013-12-13

I am using cakephp and the form helper

My form looks like this

                 <?= $form->create(info );?>
                <?= $form->input('FirstOwner.fname');?>
                <?= $form->input('FirstOwner.lname');?>
                <?= $form->input('FirstOwner.first_owner_title');?>
                <?= $form->input('FirstOwner.first_owner_precentage');?>
                <?= $form->input('FirstOwner.first_home_address');?>
                <?= $form->input('FirstOwner.first_owner_city');?>
                <?= $form->input('FirstOwner.first_owner_state');?>
                <?= $form->input('FirstOwner.first_owner_zip');?>
   <?= $form->end(); ?>

The html output is

<div class="input text"><label for="FirstOwnerFname">Fname</
label><input name="data[FirstOwner][fname]" type="text"
maxlength="255" value="" id="FirstOwnerFname" /></div>           <div
class="input text"><label for="FirstOwnerLname">Lname</label><input
name="data[FirstOwner][lname]" type="text" maxlength="255" value=""
id="FirstOwnerLname" /></div>

how can i obfuscate/hash the id name and id?

I want it to produces something like

<div class="input text"><label for="FirstOwnerFname">Fname</
label><input name="5sdf65sf6g56asdf56as" type="text" maxlength="255"
value="" id="asd45a5sd4a5sd45ad" /
0
Comment
Question by:tomjenkins12
  • 2
3 Comments
 
LVL 20

Expert Comment

by:Mark Brady
Comment Utility
You can hash it by adding the hash command.

$form->MD5(input('FirstOwner.fname'));
0
 

Author Comment

by:tomjenkins12
Comment Utility
thanks elvin66

<div class="input text"><label for="7313d9266b516ce2fced1e401b08337f89c84e15">7313d9266b516ce2fced1e401b08337f89c84e15</label><input class="valid" name="data[7313d9266b516ce2fced1e401b08337f89c84e15]" value="" id="7313d9266b516ce2fced1e401b08337f89c84e15" type="text"></div>

Im almost there

two issues
1. label name is now changed when i wanted just the form id changed

2. it now does not enter the results into the db for this filed. any suggestions?
0
 
LVL 20

Accepted Solution

by:
Mark Brady earned 500 total points
Comment Utility
Try moving the MD5 command around a bit, put it right before the input name= part. like this

$form->input(MD5('FirstOwner.fname'));
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now