...

View Full Version : Redirection of Survey Participants based on Subject Number



DWMikesellLab
07-27-2011, 10:22 PM
Hello,

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,
-Derek

Fumigator
07-28-2011, 03:31 PM
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.



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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum