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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:35:07+00:00 2026-05-31T09:35:07+00:00

On my website, I have a search.php page that makes $.get requests to pages

  • 0

On my website, I have a search.php page that makes $.get requests to pages like search_data.php and search_user_data.php etc.

The problem is all of these files are located within my public html folder.

Even though someone could browse to www.mysite.com/search_user_data.php, all of the data processed is properly escaped and handled, but on a professional level this is inadequate to even have this file within public reach.

I have tried moving the sensitive files to my web root, however since Jquery is making $.get requests and passing variables in the URL, this doesn’t work.

Does anyone know any methods to firmly secure these vulnerable pages?

  • 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-31T09:35:08+00:00Added an answer on May 31, 2026 at 9:35 am

    What you describe is normal.

    You have PHP files that are reachable in your www directory so apache (or your favored webserver) can read and process them.
    If you move them out you can’t reach them anymore so there is no real option of that sort.

    After all your PHP files for AJAX are just regular php files, likely your other project also contains php files. Right ? They are not more or less at risk than any script on your server.

    Make sure you program “clean”. Think about evil requests when writing your php functions, not after writing them.
    As you already did: correctly quote all incoming input that might hit a database or sensitive function.

    You can add security checks on your incoming values and create an automated email if you detect someone trying evil stuff. So you’ll likely receive a warning in such cases.
    But on the downside: You’ll regularly receive warnings because some companies automatically scan websites for possible bugs. So you will receive a warning on such scans as well.

    On top of writing your code as “secure” as you can, you may want to add a referer check in your code. That means your PHP file will only react if your website was given as referer when accessing it. That’s enough to block 80% of the kids out there.
    But on the downside: a few internet users do not send a referer at all, some proxies filter that. (I personally would ignore them, half the (www) internet breaks on them anyway)

    One more layer of protection can be added by htaccess, you can do most within PHP but it might still be of interest for you: http://httpd.apache.org/docs/2.0/howto/htaccess.html

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

Sidebar

Related Questions

I have a PHP based website that uses coupon codes. I can restrict search
the div on website below that have search at the bottom and it always
I'm using jQuery. I have website feature that does an ajax search and returns
I have a lot of pages on my website that are the following format:
i have a website page that contains only data of which one field gives
I have a classifieds website... The classifieds are displayed in a dynamic php page.
i have a website that allows people to get the manual online. i have
In my website I have implemented search feature using full-text search. It works fine
Say you have a website for users to search for hotel rooms for rent.
I have created a search bar for my website, the user may search a

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.