Help - Search - Members - Calendar
Full Version: Php Problems
Zymic Webmaster Forums > Web Design & Development > Server Side Scripting > PHP
Shadow Link
I figure I'd designate this topic towards my PHP problems, rather than asking sleeping people on IRC.

I will provide a "Problem", where I describe what I need or what is wrong. I will also provide a "Reason" - why I need what I describe, and what I intend to use the solution for. This is to help you better understand my situation. PLEASE NOTE: If you have better solutions for my problems, please suggest them! I may have overlooked something much more simple.

=-=-=-=-=-=-=-=-=

Problem #1: Banning Proxies
I need to know how to get the contents of the user's address bar without using $_SERVER. Basically, I'm looking for the equivalent of Javascript's "location.href"

Reason:
$_SERVER only returns server-side information. The usage I intend to put this towards is banning proxies. As you know, proxies distinctly change the URL of the browser. If the site isn't accessed by the intended URL, boom, proxy! I used a Javascript to try this, and sure enough it worked perfectly - but some proxies turn off Javascript or inject their own code. Likewise, anyone I ban from accessing my site can still get in with a proxy OR by simply turning Javascript off. I don't want to make my site a "Javascript-enabled-only" site, so shedding some light on this would be really great!

=-=-=-=-=-=-=-=-=

Problem #2: Banning Users/IP address(es)
Currently, I am using a script to ban a selected list of IP addresses from accessing my website. The reason I had to turn to this alternative is because .htaccess was not working correctly. I have tried this method:

CODE
<Files *>
order allow,deny
allow from all
deny from xx.xx.xx.x
</Files>


1) Does Zymic allow banning via .htaccess, or do I have to stick with my current method?
2) If Zymic does allow banning with .htaccess, will the users be banned from viewing all pages, subdirectories, and pages contained in them?

Reason:
As good of a reason as anybody else's. Security and Safety. My site is a personal website, containing personal information. While I allow everyone to view it, I have my list of uninvited people. Using .htaccess would also save me 1 script and many occurrences of php include(). There's also the possibility of the off-chance that I forget to use include() when making a new page.

=-=-=-=-=-=-=-=-=

Many thanks go out to those who try to help! I have spent countless days googling for answers, but ended up stumped when trying any and all solutions provided. I appreciate you taking your time to read this, and I hope you may help me solve these issues so that I may continue developing my website on this great host. smile.gif
NDBoost
QUOTE(Shadow Link @ Aug 29 2009, 05:37 AM) *
I figure I'd designate this topic towards my PHP problems, rather than asking sleeping people on IRC.

I will provide a "Problem", where I describe what I need or what is wrong. I will also provide a "Reason" - why I need what I describe, and what I intend to use the solution for. This is to help you better understand my situation. PLEASE NOTE: If you have better solutions for my problems, please suggest them! I may have overlooked something much more simple.

=-=-=-=-=-=-=-=-=

Problem #1: Banning Proxies
I need to know how to get the contents of the user's address bar without using $_SERVER. Basically, I'm looking for the equivalent of Javascript's "location.href"

Reason:
$_SERVER only returns server-side information. The usage I intend to put this towards is banning proxies. As you know, proxies distinctly change the URL of the browser. If the site isn't accessed by the intended URL, boom, proxy! I used a Javascript to try this, and sure enough it worked perfectly - but some proxies turn off Javascript or inject their own code. Likewise, anyone I ban from accessing my site can still get in with a proxy OR by simply turning Javascript off. I don't want to make my site a "Javascript-enabled-only" site, so shedding some light on this would be really great!

=-=-=-=-=-=-=-=-=

Problem #2: Banning Users/IP address(es)
Currently, I am using a script to ban a selected list of IP addresses from accessing my website. The reason I had to turn to this alternative is because .htaccess was not working correctly. I have tried this method:

CODE
<Files *>
order allow,deny
allow from all
deny from xx.xx.xx.x
</Files>


1) Does Zymic allow banning via .htaccess, or do I have to stick with my current method?
2) If Zymic does allow banning with .htaccess, will the users be banned from viewing all pages, subdirectories, and pages contained in them?

Reason:
As good of a reason as anybody else's. Security and Safety. My site is a personal website, containing personal information. While I allow everyone to view it, I have my list of uninvited people. Using .htaccess would also save me 1 script and many occurrences of php include(). There's also the possibility of the off-chance that I forget to use include() when making a new page.

=-=-=-=-=-=-=-=-=

Many thanks go out to those who try to help! I have spent countless days googling for answers, but ended up stumped when trying any and all solutions provided. I appreciate you taking your time to read this, and I hope you may help me solve these issues so that I may continue developing my website on this great host. smile.gif


I can tell you for #2,

build an array from a db or text file of banned IP addressed... use a conditional statement to die(); if the $REMOTE_ADDR matches any IP on the list.
Shadow Link
QUOTE(NDBoost @ Sep 4 2009, 01:48 PM) *
I can tell you for #2,

build an array from a db or text file of banned IP addressed... use a conditional statement to die(); if the $REMOTE_ADDR matches any IP on the list.


Great suggestion, only I've already done that:

QUOTE(Shadow Link @ Aug 29 2009, 05:37 AM) *
Currently, I am using a script to ban a selected list of IP addresses from accessing my website.


Thanks for the help though. smile.gif At this point I just want .htaccess to work as it should.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.