Are there anyway to hide form values ?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
smashhell
Forum Newbie
Posts: 14
Joined: Fri May 22, 2009 2:54 am

Are there anyway to hide form values ?

Post by smashhell »

Hello, I need help. I tired searching but came out with no solution.
I am trying to build a shopping cart where it sends shipping and payment information to Paypal through a form.
But I don't want the user or anyone to be able to see those information.

The problem is that I couldn't hide the information. Anyone can just use "View Source" to see what I am sending in the form fields.
Are there anyway to hide the values so that no one can see them ?
Please Help :(

Here are my code:

Code: Select all

<form action="cart.php" method="post">
<input type='hidden' name= 'selResidential' value='<?php echo $resdiential; ?>' />
<input type='hidden' name= 'selPackaging' value='<?php echo $packaging; ?>' />
<input type='hidden' name= 'selRate' value='<?php echo $rate; ?>' />
<input type='hidden' name= 'txtFromZip' value='<?php echo $fromzip; ?>' />
<input type='hidden' name= 'txtFromCity' value='<?php echo $fromcity; ?>' />
<input type='hidden' name= 'txtFromCountry' value='<?php echo $fromcountry; ?>' />
<input type='hidden' name= 'txtToZip' value='<?php echo $tozip; ?>' />
<input type='hidden' name= 'txtToCity' value='<?php echo $tocity; ?>' />
<input type='hidden' name= 'txtToCountry' value='<?php echo $tocountry; ?>' />
<input type="submit" value="Submit" />
  </form>
Even if they are hidden forms, the user can just "View Source" and see all the values. :(
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Are there anyway to hide form values ?

Post by social_experiment »

You have to use javascript for this and even then it's not a sure thing because not everyone has javascript enabled on their browsers.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
smashhell
Forum Newbie
Posts: 14
Joined: Fri May 22, 2009 2:54 am

Re: Are there anyway to hide form values ?

Post by smashhell »

social_experiment wrote:You have to use javascript for this and even then it's not a sure thing because not everyone has javascript enabled on their browsers.
Oh, I do not know how to code javascript.
There isn't any other way ?
Surely there must be a secure way to transmit those data. :(
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Are there anyway to hide form values ?

Post by social_experiment »

I'm not aware of another way to hide those values, Javascript works because it is client-side (on the browser). If you want to transfer the information securely you should use an SSL connection.
smashhell wrote:Anyone can just use "View Source" to see what I am sending in the form fields.
This will be a person sending the information viewing their own information wouldn't it?
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
smashhell
Forum Newbie
Posts: 14
Joined: Fri May 22, 2009 2:54 am

Re: Are there anyway to hide form values ?

Post by smashhell »

social_experiment wrote:This will be a person sending the information viewing their own information wouldn't it?
Some of it are their own information, but I have some payment information that I don't want the user to see.
kailash.lambe
Forum Newbie
Posts: 1
Joined: Tue Nov 30, 2010 7:12 am

Re: Are there anyway to hide form values ?

Post by kailash.lambe »

Send data through CURl, try it..
Bind
Forum Contributor
Posts: 102
Joined: Wed Feb 03, 2010 1:22 am

Re: Are there anyway to hide form values ?

Post by Bind »

You can use SSL and a database instead of including them in hidden inputs when chaining multiple page forms or develop more efficient form and processing code so multiple forms are not required.

I have been coding apps for paypal payments for a while now and I have never seen the requirement to send paypal ANY customer information other than the Instant Payment Notification requests through their IPN API for automated payment confirmations, considering the customer enters all the information paypal needs when they make the purchase on the paypal payment pages. Your post doesnt make much sense to me in that regard when you claim the need to send paypal customer information.
Post Reply