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

  • SEARCH
  • Home
  • 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 7415629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:20:20+00:00 2026-05-29T07:20:20+00:00

i am using Ajax to send JSON data over to my server for a

  • 0

i am using Ajax to send JSON data over to my server for a php script to parse.

for example this is the JSON which will be outputted:
http://myserver.com/parse.php?user=123&point=100&callback……

and the “parse.php” script will GET the points in the URL and give it to that user which the user id is stored in the user=123.

However , if a person directly use “http://myserver.com/parse.php?user=123&point=100&callback……” on their browser without letting my javascript to initiate it , they can cheat their points , which they can set to any amount they like in the URL.

So how can i protect/authenticate the JSON request??

  • 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-05-29T07:20:21+00:00Added an answer on May 29, 2026 at 7:20 am

    If you’re passing the user points via an AJAX request or something similar client-side, then you simply cannot protect your application against cheating. Your user is telling the script he/she scored 100 points, how can you be sure that’s the fair number? Pass over the initial data you’re using to compute your score, like valid answers for the questions or whatever it is you’re measuring.

    If you have a login mechanism in your application, you could check for the valid credentials on the server-side when executing your script, without actually passing the user identifier via GET/POST.

    Lastly, in your method you can check for the AJAX header and the referer ($_SERVER['HTTP_X_REQUESTED_WITH'] and $_SERVER['HTTP_REFERER']) to make sure the request comes from your JS code, but this is really just a minor tweak which is easy to compromize. Also, not every browser passes the referer header (depends on privacy settings), so further problems may arise.

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

Sidebar

Related Questions

I am using $.ajax function to send json data to serverside function. var jsonObjects
I have following json data which I want to pass it to server using
I am using PHP to send a json string to jQuery ajax. I am
I obtained the data from the server using ajax like this: (EDITED) $(document).ready(function() {
I'm trying to send the node instance JSON data using an ajax get request
I'm trying to send a Json array over using an AJAX call to a
i want to send json to server using Spring 3.x, i use annotation @RequestBody,
I am working on a comment script using ajax, json and jquery. I have
I made a script to get JSON data from a file on our server
I am using ajax to send data into a django view with data coming

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.