Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2011
    Thanked 0 Times in 0 Posts

    Lightbulb Redirection of Survey Participants based on Subject Number


    I am creating a survey instrument using MySQL and I need some help please:

    Let's assume there are 16 subjects in my survey and four conditions (layouts) and 5 different treatments (choice sets) in those conditions.

    I want Subjects 1,5,9 & 13 to get directed to Layout 1 and also to a random choice set out of the 5.

    I want Subjects 2,6,10 & 14 to get directed to Layout 2 and also to a random choice set of the 5.

    I want Subjects 3,7,11,15 to get directed to Layout 3 and also to a random choice set of the 5.

    I want Subjects 4,8,12,16 to get directed to Layout 4 and also to a random choice set of the 5.

    As of now I have a URL cookie set which keeps track of the Subject which is ironed out. But now I need help finding a way to have my webpage direct these subjects to the various layouts and choice sets as I stated above.

    I'm a complete noob with cookies, mysql and php and the limited resources I have at my disposal just aren't cutting it -- I am in need of some serious consultation.

    Thank you,

  2. #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Thanked 637 Times in 625 Posts
    This really isn't a MySQL question, more a website or PHP question, I'd say. And you use the terms "layout" and "choice set", without really defining what you mean by them. Are they separate HTML files? PHP scripts that generate HTML?

    In PHP, you can use the header() function to redirect to a different webpage, as long as you haven't generated any output yet.

    PHP Code:
    header("Location: http://someotherwebpage.com");
    //good practice to call die() after the redirect 


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts