|
Joined: Jan 2003
Posts: 250
Member
|
Member
Joined: Jan 2003
Posts: 250 |
Hi all, I am getting the occasional member who cannot post for due to a bad referrer. Sometimes it allows them and other times it doesn't, but the intermitent ones I think may have been cookie related because I see them posting and do not hear them complaining about not being able to. However, I have one member who has posted a few times, but from his work machine cannot at all... he keeps getting killed in the check_refer function: <br /> // ####################################################################### <br /> // Check_refer <br /> // ####################################################################### <br /> function check_refer($Cat="") {<br /><br /> global $config,$ubbt_lang;<br /> $valid = 0; <br /> $referers = split("\|",$config['referer']);<br /> for ($i=0; $i <= (sizeof($referers)-1); $i++) {<br /> if (stristr(find_environmental('HTTP_REFERER'),$referers[$i])) {<br /> $valid++;<br /> }<br /> }<br /> if (!$valid) {<br /> $this -> not_right($ubbt_lang['NOT_VALID'],$Cat);<br /> }<br /> }<br /> I wrote a little test to see what his referrer was, and viola... blank. After some research on this in the PHP manual site, I find that checking the HTTP_REFERRER is not always viable since some servers will not reveal that info. So, I added a quick patch for this use to check for his static IP address like this: <br /> // ####################################################################### <br /> // Check_refer <br /> // ####################################################################### <br /> function check_refer($Cat="") {<br /><br /> global $config,$ubbt_lang;<br /> $valid = 0; <br /> $referers = split("\|",$config['referer']);<br /> for ($i=0; $i <= (sizeof($referers)-1); $i++) {<br /> if (stristr(find_environmental('HTTP_REFERER'),$referers[$i])) {<br /> $valid++;<br /> }<br /> }<br /> if (find_environmental('REMOTE_ADDRESS') == "xxx.xxx.xxx.xxx") {<br /> $valid++;<br /> }<br /> if (!$valid) {<br /> $this -> not_right($ubbt_lang['NOT_VALID'],$Cat);<br /> }<br /> }<br /> He still cannot post and get the ubbt_lang['NOT_VALID'] = "The host you are trying to send the input from is not a valid host."; message... Why??? Is there anything I can do to get this guy posting consistently??? Thanks!!
"Some dream of doing great things, while others stay awake and get on with it." -- Anonymous
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
Most work computers are behind a firewall. Firewall software and/or hardware blocks the referer. Norton/Windows XP "out of the box" used to block the referer. Instructions to adjust that are here: Browser Problems
|
|
|
|
Joined: Feb 2001
Posts: 2,268
Junior Member
|
Junior Member
Joined: Feb 2001
Posts: 2,268 |
Network Address Translation -firewalls mask the addresses behind them by replacing the source address with the address of the firewall. If you put the IP address of the firewall that he's behind into your script then it might work 
|
|
|
|
Joined: Jan 2003
Posts: 250
Member
|
Member
Joined: Jan 2003
Posts: 250 |
"Some dream of doing great things, while others stay awake and get on with it." -- Anonymous
|
|
|
|
Joined: Jan 2003
Posts: 250
Member
|
Member
Joined: Jan 2003
Posts: 250 |
Thanks, DLT... would this be a different IP than the one I am getting from the REMOTE_ADDRESS env. var?
"Some dream of doing great things, while others stay awake and get on with it." -- Anonymous
|
|
|
|
Joined: Feb 2001
Posts: 2,268
Junior Member
|
Junior Member
Joined: Feb 2001
Posts: 2,268 |
If you are "seeing" the address at your web server, then it's the IP address of the firewall. Keep in mind that some ISPs / companies use multiple firewalls for load balancing, and since HTTP is a "connection less" protocol you could see all the firewall IPs during a single page request. You might have better luck expanding your check to the first three octets of the IP address.
|
|
|
|
Joined: Jan 2003
Posts: 250
Member
|
Member
Joined: Jan 2003
Posts: 250 |
Everytime this user logs in though he has the same IP... is that just coincidence or expected?
"Some dream of doing great things, while others stay awake and get on with it." -- Anonymous
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 254
Joined: January 2000
|
|
Forums63
Topics37,575
Posts293,930
Members13,823
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|