dad00 Posted August 10, 2009 Share Posted August 10, 2009 Hi, Ive got a form which is a add to cart button but using google chrome or firebug(i think) firefox plugin they can edit the values on the form hence making them able to get items for free. I can use javascript to stop them but not everyone has javascript enabled is there a way i can do it with php? Quote Link to comment https://forums.phpfreaks.com/topic/169574-stop-people-editing-the-form-elements/ Share on other sites More sharing options...
trq Posted August 10, 2009 Share Posted August 10, 2009 Your form submission should be validated server-side using php not client-side using whatever it is your using at the moment. Quote Link to comment https://forums.phpfreaks.com/topic/169574-stop-people-editing-the-form-elements/#findComment-894662 Share on other sites More sharing options...
dad00 Posted August 10, 2009 Author Share Posted August 10, 2009 yeah theres a problem though ive also got a paypal buy now button which has the price and everything but i have no way of validating that before it gets to paypal Quote Link to comment https://forums.phpfreaks.com/topic/169574-stop-people-editing-the-form-elements/#findComment-894665 Share on other sites More sharing options...
grunshaw Posted August 10, 2009 Share Posted August 10, 2009 You could make the elements hidden instead, or you could use the "disabled" tag at the end of the element. Not sure how this would work for you though. Quote Link to comment https://forums.phpfreaks.com/topic/169574-stop-people-editing-the-form-elements/#findComment-894679 Share on other sites More sharing options...
dad00 Posted August 10, 2009 Author Share Posted August 10, 2009 the elements are hidden but their still editable with google chrome Quote Link to comment https://forums.phpfreaks.com/topic/169574-stop-people-editing-the-form-elements/#findComment-894687 Share on other sites More sharing options...
GingerRobot Posted August 10, 2009 Share Posted August 10, 2009 the elements are hidden but their still editable with google chrome Or indeed anyone by hand, the firebug extension for firefox and bots to name but a few. You must be doing something wrong if the user has an opportunity to change the price. Quote Link to comment https://forums.phpfreaks.com/topic/169574-stop-people-editing-the-form-elements/#findComment-894689 Share on other sites More sharing options...
dad00 Posted August 10, 2009 Author Share Posted August 10, 2009 its because im using a html form its the only way i can do it for what i need. And paypal uses a html form Quote Link to comment https://forums.phpfreaks.com/topic/169574-stop-people-editing-the-form-elements/#findComment-894691 Share on other sites More sharing options...
dad00 Posted August 10, 2009 Author Share Posted August 10, 2009 or is there a way i can transfer $_post data without a form Quote Link to comment https://forums.phpfreaks.com/topic/169574-stop-people-editing-the-form-elements/#findComment-894729 Share on other sites More sharing options...
GingerRobot Posted August 10, 2009 Share Posted August 10, 2009 or is there a way i can transfer $_post data without a form Yes. You can use cURL for starters. However, isn't there a paypal API for all this? Quote Link to comment https://forums.phpfreaks.com/topic/169574-stop-people-editing-the-form-elements/#findComment-894738 Share on other sites More sharing options...
mars_rahul Posted August 10, 2009 Share Posted August 10, 2009 Why don't you define desired value as session variable and before doing that encrypt variable. This is general practice and better check for URL encryption. What Guru's View about it. Quote Link to comment https://forums.phpfreaks.com/topic/169574-stop-people-editing-the-form-elements/#findComment-894749 Share on other sites More sharing options...
dad00 Posted August 10, 2009 Author Share Posted August 10, 2009 they turn into a session variable when its clicked so still giving them space to edit it. and also if i encrypt the value they can still view it and decrypt it and i need to use post because i need to send the data from my site to the paypal site Quote Link to comment https://forums.phpfreaks.com/topic/169574-stop-people-editing-the-form-elements/#findComment-894787 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.