Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7444301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:28:54+00:00 2026-05-29T11:28:54+00:00

im starting to learn php, a little application im building needs to send visitors

  • 0

im starting to learn php, a little application im building needs to send visitors to specific pages based on if they have a preferance cookie and if so go to specific page based on which cookie.

so at one part of my application a visitor will be faced with three links, when a visitor clicks a link a cookie remebering the visitors preference will be sent so

Link1 = Prefcookie1
Link2 = Prefcookie2
Link3 = Prefcookie3

at another page it needs to

Check for any prefcookies
if no redirect to index1

If yes check which precookie

If prefcookie = prefcookie1 redirect to index
if prefcookie = prefcookie2 redirect to index1
if precookie = prefcookie3 redirect to index3

Or could somthing similar be achieved through htaccess?

any help greatly appreciated, its that last thing to complete this

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T11:28:55+00:00Added an answer on May 29, 2026 at 11:28 am

    PHP would work fine for this:

    <?
    if($_COOKIE['prefcookie'] == "prefcookie1")
     {header("Location: index");}
    elseif($_COOKIE['prefcookie'] == "prefcookie2")
     {header("Location: index2");}
    elseif($_COOKIE['prefcookie'] == "prefcookie3")
     {header("Location: index3");}
    else
     {header("Location: index1");}
    ?>
    

    or so

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am starting to learn PHP and have a decent Java background. I came
I am just starting to research and learn PHP. I have a decent background
I am just starting to learn php, how would I initiate a echo statement
I'm starting to learn about using Memcached with PHP and I was wondering; is
I am just starting to learn javascript, so I don't have the skills to
I'm starting to learn Python and I've come across generator functions, those that have
I'm starting to learn ASP.Net MVC (the release candidate), and I'm having a little
I'm a designer (starting to learn PHP/MySQL) and am need in an eCommerce platform
I am starting to learn everything about security and secure programming. I have always
I have been programming procedural PHP for about 8 years, and am finally starting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.