viewtopic.php?f=1&t=81137
User Redirect Using Cookies
Moderator: General Moderators
User Redirect Using Cookies
Last edited by Watertch on Wed Apr 09, 2008 2:26 pm, edited 1 time in total.
Re: User Redirect Using Cookies
Do you need it to work for multiple domains? Or multiple sites in the same .com?
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: User Redirect Using Cookies
What Sambo is getting at is you need to set the cookie for each domain specifically.
note the dot before the domain, this is to make the cookie accessible all across that domain. Also don't forget to quote your strings.
Code: Select all
setcookie('KeepAway', date("F jS - g:i a"), $Month, '.domain1.com');
setcookie('KeepAway', date("F jS - g:i a"), $Month, '.domain2.com');Re: User Redirect Using Cookies
Last edited by Watertch on Wed Apr 09, 2008 2:26 pm, edited 1 time in total.
Re: User Redirect Using Cookies
I am sorry I posted the response too soon . I attached the redirect code because I changed it. The way it is set up on the first code I posted it sets the cookie no matter what. I hope it helps someone as I did see alot of people looking for this in the wrong places. I was there looking too until I found this.
Again thanks for the help and I hope someone can use the code above. Redirect script code php
Again thanks for the help and I hope someone can use the code above. Redirect script code php
Re: User Redirect Using Cookies
Just for the record, that code would be incredibly trivial to 'hack'. Just switching off cookies would get around it.
Re: User Redirect Using Cookies
Do you have a code that might be more secure.
Re: User Redirect Using Cookies
You could add something to the user's session, that would help, but if they've disabled cookies it'll only stop them if they're too stupid to delete the session var in the URL. Maintaining a database of banned IP addresses is about the most secure system of banning people from a site, but that has other problems (like you'll be banning people who share the same IP).
Basically you can't ban people from a site without having them log in or something. If they do have to log in it's easy because you can just disable their username.
Basically you can't ban people from a site without having them log in or something. If they do have to log in it's easy because you can just disable their username.
Re: User Redirect Using Cookies
I was looking for a script the one above to redirect people coming a forum to my site. I have a customer that has taken his complaint to a public forum and trashing my name/site. I have rebuted his arguments and he still continues. He has gone all over the site posting links back to my site with derogatory statements. So for the unsuspecting the redirect I am currently using will work. You point is a very valid one. For the computer novice(95%) they will not think to disable cookies before clicking on the link to my site.
As far as creating a database for the IP's to ban Im sure I can do that via MySQL and PHP for the banned referer also. Right?
As far as creating a database for the IP's to ban Im sure I can do that via MySQL and PHP for the banned referer also. Right?
Re: User Redirect Using Cookies
Right... well my advice would be to stop what you're doing and remove all the code that's redirecting people. You have someone driving loads of traffic to your site for free. These are potential customers/users. All you need to do is persuade them that this guy is wrong about you and that they should do business with you rather than him. Spend your time writing a really polite and well reasoned page outlining what happened and why the other guy is wrong, then display it to anyone coming from the site where he's linking from.
If you send these people away or ban them they'll just think he's right, even if he isn't.
If you send these people away or ban them they'll just think he's right, even if he isn't.
Re: User Redirect Using Cookies
Ahhh right you are. Thats a good idea. I will do that. I currently redirect to a blank page that has a CSS link that is white that leads back to the index.html so I am not redirecting away from my site. I did this in fear of Google bot seeing the redirect and following it or penalize me for redirecting to another site
I used the CSS link thinking that it would avoid being seen as a hidden link to Google bot and also avoiding being penalized. I put the link to the index.html thinking that if Google bot followed it there would be a link right back to home. After typing that, I believe that Google bot would leave my site if bounced from index.html to redirect.html back to index.html correct?
Any ideas on that or am I way off base?
Im still going to use your idea of the rebutal. What a hot head I am. Duhhhhh
I used the CSS link thinking that it would avoid being seen as a hidden link to Google bot and also avoiding being penalized. I put the link to the index.html thinking that if Google bot followed it there would be a link right back to home. After typing that, I believe that Google bot would leave my site if bounced from index.html to redirect.html back to index.html correct?
Any ideas on that or am I way off base?
Im still going to use your idea of the rebutal. What a hot head I am. Duhhhhh