473,378 Members | 1,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

How to restrict access to php program?

gsb
I have a php program that sends images to my html pages.
<img src="url/send.php?id=whatever" ...

How can I stop people from linking this php program from another site or
simply typing it into their browser address bar?
Can I stop a 'wget' for example?

Thanks,

gsb
Jul 17 '05 #1
6 3080

"gsb" <gs*@QWest.net> wrote in message
news:6F*****************@news.uswest.net...
I have a php program that sends images to my html pages.
<img src="url/send.php?id=whatever" ...

How can I stop people from linking this php program from another site or
simply typing it into their browser address bar?
Can I stop a 'wget' for example?

Thanks,

gsb


1. allow only HTTP_POST
2. allow only your HHTP_REFERER
3. username & password
4. hosts.allow



Jul 17 '05 #2
> How can I stop people from linking this php program from another site or
simply typing it into their browser address bar?
Can I stop a 'wget' for example? No, you can't - what a browser can do, a download manager can do, too.

You could just stop some download managers by checking for theyr user-agents - that's all you can do. 1. allow only HTTP_POST With Images?
2. allow only your HHTP_REFERER

Many people have disabled the referer. But you can of course check for if there is a referrer, it has to be on your site.

--
mfg Christian (Chronial "at" web.de)

--
Composed with Newz Crawler 1.5 http://www.newzcrawler.com/
Jul 17 '05 #3

"Christian Fersch" <Fr********@web.de> wrote in message
news:br*************@news.t-online.com...
How can I stop people from linking this php program from another site or
simply typing it into their browser address bar?
Can I stop a 'wget' for example? No, you can't - what a browser can do, a download manager can do, too.

You could just stop some download managers by checking for theyr

user-agents - that's all you can do.
1. allow only HTTP_POST

With Images?
2. allow only your HHTP_REFERER

Many people have disabled the referer. But you can of course check for if

there is a referrer, it has to be on your site.
--
mfg Christian (Chronial "at" web.de)

--
Composed with Newz Crawler 1.5 http://www.newzcrawler.com/


Guess you may be right about the POSTs Christian.
I misread his message as other people were sending (or uploading) images to
him.


Jul 17 '05 #4
gsb
Christian,

I'm a light weight here for sure. Thanks for your help, all.
I do not understand "...checking for their user-agents..."
What would I be checking for and how could I use this.

xyzzy,

Thanks. I'm looking into both the http_referrer and my .htaccess settings.
Login is not an option here.

Thanks again all,

gsb
Jul 17 '05 #5
Every Programm should give it's name in the user-agent Header when accesing a webserver.
Just don't allow acces with user-agents known as download managers.

But of course a lot of download managers fake theyr user-agent, so you can't protect yourself from them.

--
mfg Christian (Chronial "at" web.de)

--
Composed with Newz Crawler 1.5 http://www.newzcrawler.com/
Jul 17 '05 #6
gsb
Thanks again.
gsb

"Christian Fersch" <Fr********@web.de> wrote in message
news:br*************@news.t-online.com...
Every Programm should give it's name in the user-agent Header when accesing a webserver. Just don't allow acces with user-agents known as download managers.

But of course a lot of download managers fake theyr user-agent, so you can't protect yourself from them.
--
mfg Christian (Chronial "at" web.de)

--
Composed with Newz Crawler 1.5 http://www.newzcrawler.com/

Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Paul | last post by:
Hi all, at present I I've built a website which can be updated by admin and users. My problem, I've combined "log in" and "access levels" to restrict access to certain pages, using the built...
1
by: Olivier Sauterel | last post by:
Hi all, Anyone can tell me if it's possible to restrict the access of a classes library (dll .NET) ? For sample restrict the possibility to explore all classes and there features into the...
4
by: Vijay Kumar R Zanvar | last post by:
Greetings, Are the following inferences of mine correct? 1. #include <string.h> char *strcpy(char * restrict s1, const char * restrict s2); a. s1 != s2 b. That means,
7
by: tweak | last post by:
Can someone give me a short example as how to best use this keyword in your code? This is my understanding: by definition restrict sounds like it is suppose to restrict access to memory...
5
by: toddles666 | last post by:
Hi- Is there any way of restricting access to a database by application & account? For example, I only want the application APP1 to access the database using the USER1 account. I've tried to...
2
by: pemo | last post by:
In Harbison and Steele's book, they say that using 'restrict' allows functions like memcpy() to be prototyped like this: void * memcpy(void * restrict s1, const void * restrict s2, size_t n); ...
12
by: Me | last post by:
I'm trying to wrap my head around the wording but from what I think the standard says: 1. it's impossible to swap a restrict pointer with another pointer, i.e. int a = 1, b = 2; int *...
21
by: Niu Xiao | last post by:
I see a lot of use in function declarations, such as size_t fread(void* restrict ptr, size_t size, size_t nobj, FILE* restrict fp); but what does the keyword 'restrict' mean? there is no...
2
by: Frederick Gotham | last post by:
I'm going to be using an acronym a lot in this post: IINM = If I'm not mistaken Let's say we've got translation units which are going to be compiled to object files, and that these object...
6
by: rainy6144 | last post by:
Does the following code have defined behavior? double *new_array(unsigned n) { double *p = malloc(n * sizeof(double)); unsigned i; for (i = 0; i < n; i++) p = 0.0; return p; }
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.