PDA

View Full Version : working with forms


gigiloumill
07-18-2011, 08:41 PM
Guys, I don't know if this is the right place to ask...I need to create a form, the form needs to have an api key imbedded. My problem is I can't have the key visible...Would anyone know how to make form and hide the api key? Thanks

Corrosive
07-19-2011, 06:47 AM
It usually works that you have a public key (that you can publish) and a private key in your PHP that will be parsed before anyone gets chance to nab it. Can you explain a little more about what you are doing please?

gigiloumill
07-19-2011, 12:21 PM
Thanks C, I am creating a webform to send info back to a crm and I need to include the config.inc.php api on the form...For obvious reasons I need to hide key...

<body>
<form method="POST" action="http://osauces.com/test/vtigercrm/modules/Webforms/post.php">
<p>
<input type=hidden value="Contacts" name="moduleName" />
<input type=hidden value="*****************************" name="appKey" />
</p>
<td><p>
<label for="lastname">Last name:</label>
<input type="text" name="lastname" id="lastname" />
</p>
<p>
<label for="firstname">First name:</label>
<input type="text" name="firstname" id="firstname" />
</p>
<p>
<label for="email">E mail:</label>
<input type="text" name="email" id="email" />
</p>
<p>
<label for="phone">Phone:</label>
<input type="text" name="phone" id="phone" />
</p>
<p>
<label for="description">description</label>
<textarea name="description" id="description" cols="45" rows="5"></textarea>
</p>
</p>
<p>Submit
<input type="submit" name="button" id="button" value="Submit" />
&nbsp;</p></td></form>

Corrosive
07-19-2011, 03:00 PM
Yeah, I see your point. Sorry, no idea :(

gigiloumill
07-20-2011, 12:35 AM
Wow, I got one by you C...anybody else? thanks

gigiloumill
07-20-2011, 01:45 AM
C, do you think it would work as a php include?

edbr
07-20-2011, 02:25 AM
could you add as a conditional statement? maybe a hidden text
<input type=hidden value="squirrel" name="secret" />

if ( $_post['secret'] =='squirrel' {echo "*****************************"} just a stab in the dark here

gigiloumill
07-20-2011, 02:41 AM
Thanks E, I see where you're going with that... I don't get this one:if ( $_post['secret'] =='squirrel' {echo "*****************************"}, where am I including this?

edbr
07-20-2011, 02:51 AM
i was thinking to add that to your form , just a s a check if ness

gigiloumill
07-20-2011, 03:02 AM
I get what you're saying, what I don't get is where to include the code..Obviously I can't include in same code..Can I add as php include?

gigiloumill
07-20-2011, 12:41 PM
No good...

gigiloumill
07-21-2011, 01:52 AM
O.K. guys, I found the solution...I don't need it after all....lol