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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:55:22+00:00 2026-06-11T15:55:22+00:00

I am using WAMP and hosting the PHP files locally. Assume i have these

  • 0

I am using WAMP and hosting the PHP files locally.

Assume i have these two files.

customer.php– A form to add customer details

recordCustomer.php– Connects to the database and store the information in the database(where all the processing is done)

How do I stop a user from accessing the file recordCustomer.php by typing the file name in the address bar.

http://localhost/testing/recordCustomer.php has to be redirected and given an error message

However

http://localhost/testing/customer.php is allowed

Thank you

  • 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-11T15:55:23+00:00Added an answer on June 11, 2026 at 3:55 pm

    The problem is not the access to recordCustomer.php but the fact that you execute the code if the access is direct.
    Preventing the access by htaccess for example, will make your form unsubmitable.

    You should use an random token in your customer.php form. The token is saved into session and inserted into the form with a hidden input.

    On recordCustomer.php you just have to check if the token is given and if it match the one in session.

    If it match => this is a legit call to recordCustomer.php
    else => try to bypass your form , reject the request.

    That’s a school case of CSRF attack 😉

    Have a look here for example

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

Sidebar

Related Questions

I have installed PHP using wamp server in Windows and I have give the
I have read the following tutorial Uploading Files To the Server Using PHP and
I am using wamp, and I have two directories; /www and /scripts. In /www
I am using: WAMP PHP 5.3 XDebug NetBeans I want to debug and have
Am using WAMP server for PHP development. I have created a cookie in my
I've been using WAMP to work with PHP. These days after joining PHP mailing
I'm using wamp server. And I use dreamweaver to create php files. Here is
I'm using WAMP server. I have my php.ini set to utf-8 and also I
I have downloaded an auto completion(jQuery script) form from net. I am using wamp
I'm using Wamp 2.2, edited conf/extra/httpd-vhosts.conf edited this file to add VirtualHosts , but

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.