Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7968037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:00:50+00:00 2026-06-04T07:00:50+00:00

I use ajax to submit value to the server. $.ajax({ type: POST, url: services.php,

  • 0

I use ajax to submit value to the server.

$.ajax({
type: "POST",
url: "services.php",
data: "a=1&b=2&c=3&d=4",
success: function(msg)
{
}
}); 

I face one problem. As you know, an experienced user can easily change the passing parameter value by keying following url in the browser url bar.

Eg: mywebsite.com/services.php?a=0&b=0&c=0&d=0

As far as I know, hashing (parameter +secret key) in Javascript. Then, I pass the parameter value together with hashed value to the server. Hashing(parameter +secret key) is done in php script. If both hashed values matches, it will update data in the database.

Basically,

In javascript: sort(parameter) -> join(parameter) -> md5(parameter)
In php script: sort(parameter) -> join(parameter) -> md5(parameter) -> compare both hashed values

Is there any suitable way to prevent it from being changed?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T07:00:51+00:00Added an answer on June 4, 2026 at 7:00 am

    The trick is how do you keep the secret key hidden from the user in the javascript? If you expose it, the user can still make changes and just rehash the parameters. You can’t really prevent this sort of modification, which is why you need to sanitize and validate all the input on the server side.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do i use ajax to send POST requests to the server instead of
I'm trying to use cURL to post data to the form on this URL:
I'm trying to use cURL to post data to the form on this URL:
I'm trying to use the following code to log users in: $(form).submit(function(event) { $.ajax({
I would like to use jQuery.ajax to submit a form using POST without having
I am trying to use the jQuery $.post method to submit an ajax request
I am trying to use .ajax() to post a People object to a MVC2
I have many forms that use AJAX (w/ jQuery) for validation and data submission.
I have a contact form i want to use Ajax for. My contact.php script
I am using php/ajax to submit a form without page refresh. Here are my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.