Solved

no cookies

Posted on 2006-10-22
1
241 Views
Last Modified: 2008-03-17
hello,
is there a way to detect if my surfers are using cookies or not?
so I can make a page for cookie users and one for no cookie!
so if the user goes into index.php to redirect them to
index_cookie.php or to index_nocookier.php
can someone help me make this?
0
Comment
Question by:Sabrin
1 Comment
 
LVL 19

Accepted Solution

by:
BrianGEFF719 earned 500 total points
ID: 17785734
Hi Sabrin,

index.php code:

setcookie("checkCookies", "cookieCheck"); //write a cookie
header('Location: http://www.mysite.com/cookieCheck.php'); //send to a page that will check if the cookie was written


cookieCheck.php code:

if (isset($_COOKIE['checkCookies'])) {
   header("location: http://www.mysite.com/cookiesWork.php"); //send to cookies page
} else {
   header("location: http://www.mysite.com/noCookies.php"); //send to no cookies page
}


Try something like that.


-Brian
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now