Click here to Skip to main content
15,886,788 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I need a help for my PHP script (specially wordpress) that only should be able to run in my own application written by C# (Not with other browsers like Chrome, IE &....
Guide me if you can.
Thanks
Posted
Updated 27-Aug-14 6:44am
v2
Comments
ZurdoDev 27-Aug-14 12:48pm    
Can you explain more? This does not make sense.
[no name] 27-Aug-14 12:52pm    
I mean my application sends a request to webpage and it display itself in my application's webbrowser, otherwise don't display it in any external browsers, like Chrome, IE... is it clear?
ZurdoDev 27-Aug-14 12:55pm    
No, it isn't very clear. However, you could try setting the userAgent string and then have code that only allows your custom string through.
Sergey Alexandrovich Kryukov 27-Aug-14 12:50pm    
What does it mean, really? Especially when you say "script", that is, just some text? From the other hand, if the script is the part of the Web site/application, it is on the server side, and no one has access to it? It can be run through some URL. Do you mean that it should be requested only form some of your pages, nothing else?
—SA
[no name] 27-Aug-14 12:53pm    
I mean php script, like wordpress or any other php. It should deny any request from any browser except my C# Winform application's web browser.

1 solution

Please see my comment to the question. I cannot be sure I understand what you want correctly; and I cannot be even sure that you understand it. However, if I can make an assumption that you need some functionality only of the request to a PHP page is sent from a certain page on your site, your script can check up the referer of the HTTP request and do some job only if the referer corresponds to some expected URL; in other cases, it should show something else, redirect to other page, etc.

Please see 'HTTP_REFERER' here: http://php.net/manual/en/reserved.variables.server.php[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900