?
Solved

cakephp, obfuscate,hash, form ids

Posted on 2011-03-14
3
Medium Priority
?
608 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
ID: 35134121
You can hash it by adding the hash command.

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

Author Comment

by:tomjenkins12
ID: 35139478
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 2000 total points
ID: 35141898
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month13 days, 12 hours left to enroll

755 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