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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:10:44+00:00 2026-05-31T06:10:44+00:00

My backend is PHP I have a service that I want to put out

  • 0

My backend is PHP

I have a service that I want to put out online lets call it GREATSERVICE.com. I want to have people sign up for an API key and restrict it by domain so that only http://www.????.com can use it.
I know I can just store the API and domain that the person enters into the database.

I’m hung up on how to validate that the service is being accessed by the proper web site.

I mean lets say I’m cruising the web with the domain address temp-13-43.xfinity.com and I go to website servicehost.com. servicehost.com has an API key….as how do I recognize the service is being accessed from servicehost.com and not the clients temp-13-43.xfinity.com address…

So what I’m trying to figure out is to this in JavaScript on the client side. Kind of like Google Maps. Maps just loads some JavaScript onto the page with an API key but the API key checks the URL of the WEB SITE and not the client visiting the website.

That is where I’m lost. How can I check the DOMAIN of the site that the user went to and only if it is correct wiht the correct API then render the service out.

So in the head section I have JavaScript

So on the SERVICEHOST site I give them the code so that they can use the mygreatservice widget. Think along the lines of the twitter embedded viewer

<SCRIPT type="text/javascript" src="http://mygreatservice.com/service.php?api=asdfasdfasdfa></SCRIPT

Tags which point to a PHP page to return the need JavaScript. Again I just want to make sure that the widget I’m returning is used on the proper sites for light security/tracking purposes.

  • 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-31T06:10:45+00:00Added an answer on May 31, 2026 at 6:10 am

    Edit:

    Ask your members to put this line in their site: (for instance I put this code in my server http://www.otherserver.com)

    <script language="javascript" src="http://yourserver.com/service.php?token=342424adsasjdl34"></script>
    

    In your service.php file (hosted on your server):

    $server = $_SERVER['SERVER_NAME']; // =www.otherserver.com
    $apitoken = $_GET['token']; // the token 342424adsasjdl34 (don't forget to make it safe!)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web application that has some logic calculation duplication on PHP backend
I have a php file , For example http://domain.com/user?id=uniquetoken ,When user visits that url
I have a Flash app with a PHP backend. Whenever there is a PHP
I use subversion to manage my yii website (php framework) and have separate backend
I am writing a prototype auction/listings project in PHP (MySQL backend). I have a
I have working website in PHP with a MySQL backend which has several tables
I have an application with php at front end and Java as Backend. I
Suppose you have a messaging system built in PHP with a MySQL database backend,
I have a cocoa class set up that I want to use to connect
I have a onclick event that has a value in it that I want

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.