1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Encryption of code !HELP!

Discussion in 'PHP' started by c_user, Nov 13, 2013.

  1. c_user

    c_user New Member

    Hello friends,
    I have been asked by my manager to design my code such that when a user types the URL then before loading the script in the browser ; It goes to a different server and checks the url in a particular file. If found then it will send some positive value ; On receiving the positive value the server files loads else it gives an error and nothing happens..
    Friends give me ur valuable suggestions how to achieve it!
    Thanking You ,
    Good Day.:pleased:
     
  2. David Ledger

    David Ledger New Member

    You need to step back and look at what your manager is asking you to achieve. I presume you mean
    "before loading the script on the server" rather than "browser". PHP code never hits the browser (unless its a .html instead of .php), and the browser couldn't follow it anyway.

    If what (s)he wants is like passworded access but where the 'password' is the browser's IP address, then that is simple. (Just check for it as a line in a file).

    If they are asking you to validate that the requested URL is allowed then they need to learn how the web works. If it doesn't exist the user will get a 404; if it does but is not allowed, it is already too late. It sounds to me that your manager is asking you to write an http server not a web page.

    David

    .
     
    shabbir likes this.
  3. c_user

    c_user New Member

    @David Ledger thank you for the reply.
    I got what u are saying but may be u misunderstood what i want to convey. Yes i was not descriptive and i m sorry for that.
    Say :
    I have got my project ready and it is loaded in server and the url is named as xyz.org
    when the user types xyz.org at the browser address , the request goes and the php code is executed showing the required .tpl files at the front end.
    Now what i want is my code which my company is going to give it to the client should be useful only to them not every one.
    Its like the persons who are going to buy the project will only be allowed to execute the code. Even though if the code is leaked to any person the code should not execute.
    So can u please tell me ; how i can achieve my required.
    Thanking you.
     
  4. c_user

    c_user New Member

    So what i have planned is to make a domain validation so that the list of domain in the file can execute the project code only.
     
  5. David Ledger

    David Ledger New Member

    If you put all the OK IP addresses line by line into a file which gets loaded into an array you can use a php array function to see it the requester's IP is one of the values. If you make a list of domain names you would have to do a lot more work.

    David

    .
     
    shabbir and c_user like this.
  6. c_user

    c_user New Member

    Thank a ton brother ! yup @David Ledger i have planned the same but i was thinking could there be some other way achieving the same !
     

Share This Page