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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:22:50+00:00 2026-05-19T22:22:50+00:00

I have player.php file which calls the video player to play a certain video.

  • 0

I have player.php file which calls the video player to play a certain video. How can i block certain sites from accessing this file and using it to embed videos on there site. In other words What code can i use inside player.php to block certain sites from accessing this file only.

  • 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-19T22:22:50+00:00Added an answer on May 19, 2026 at 10:22 pm

    You can do this on three levels.

    1) Web server

    For instance, using .htaccess file if you’re on an Apache server.
    This could be done with a rewrite that pushes them to some dummy file or 404 or whatever you like. For example:

    RewriteEngine on
    # Options +FollowSymlinks
    RewriteCond %{HTTP_REFERER} badsite\.com [NC]
    RewriteRule .* - [F]
    

    This is really the ideal way because it precludes the need to interpret PHP.

    2) PHP

    In your page, use the $_SERVER[‘HTTP_REFERER’] (which may not be set if there is no referrer) and search for the domain in question in the string.

    This is second best, and may be your only option if you can’t alter the Apache configuration.

    3) Javascript

    Doesn’t really prevent access to anything, because the check happens client-side (they’ve downloaded player.php and the Javascript itself prior to running it). If they went directly to the video or whatever, it wouldn’t stop them from getting the file. You would use the document.referrer and search for the domain as with the PHP example.

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

Sidebar

Related Questions

I have php script from where user can upload the video file. The file
I have PHP script which takes some file (FLV for example) and returns it
I have the following line in my Html file, which displays a video feed,
this time I have a page which will load different kinds of file formats,
I have a YouTube's player in the webpage. I need to change the video
I have a SWF Video player on my webpage. I want to draw a
We have a custom-built Flash-based video player that I maintain, and it needs to
I have code like this to move the player in my game left, right,
I love challenges like this, I'll hopefully submit my answer soon. Which player has
I have a page with mp3s that are playable from a player, and there

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.