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 8449147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:37:33+00:00 2026-06-10T10:37:33+00:00

In the past when I have written HTML with jQuery, in order to access

  • 0

In the past when I have written HTML with jQuery, in order to access specific PHP pages I have simply always done this:

user.php?Action=1&User=Adrian.....

And this would return plain text JSON, which jQuery converts into a javascript object. I have a few questions regarding this method, though.

  1. Is this safe? JSON is being passed back in plain text. Should it be used over HTTPS?
  2. How is the best way to prevent direct access to PHP? Simply checking for an active session?
  3. Is this whole approach ok?

Cheers,
Adrian

  • 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-10T10:37:35+00:00Added an answer on June 10, 2026 at 10:37 am

    For number 2, it depends what you’re doing.

    If you are doing anything with the ‘user.php’ file to make any changes to the DB, you would want to use POST rather than GET (this hides the parameters from the URL bar, and is safe if your page is getting crawled/scraped).

    To use POST, in your user.php file replace instances of $_GET with $_POST.

    In your jQuery Ajax call, make sure parameter “type” is set to “POST”

    type: "POST",

    GET requests should only ever be for doing anything that gets and displays data from your data model (DB, whatever). POST requests are for making any updates, additions (stricter would be PUT), or deletions (DELETE).

    If you want only that specific user to access the user.php script, then you would want check the user’s session and make sure it matches with the user trying to access the particular user parameter.

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

Sidebar

Related Questions

I am learning Python for the past few days and I have written this
I've written quite a few jQuery plugins in the past and this problem has
Someone must have written this before :-) I need a validation attribute for date
The simulation tool I have developed over the past couple of years, is written
I have written web apps with JSP in the past. Now, I'm getting started
Have written some RoR sites in the past, but never bothered too much at
In the past I have written C++ plugins that detoured the recvfrom() function in
All of the WinForms wizards I've written in the past have a high degree
In the past, I have written a script using the Python IMAP library to
I have written an application that is leaking memory - I've done the following

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.