Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-27-2011, 09:22 PM   PM User | #1
DWMikesellLab
New to the CF scene

 
Join Date: Jul 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
DWMikesellLab is an unknown quantity at this point
Lightbulb Redirection of Survey Participants based on Subject Number

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
DWMikesellLab is offline   Reply With Quote
Old 07-28-2011, 02:31 PM   PM User | #2
Fumigator
UE Antagonizer


 
Fumigator's Avatar
 
Join Date: Dec 2005
Location: Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
Posts: 7,686
Thanks: 42
Thanked 637 Times in 625 Posts
Fumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of light
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");
die(); 
//good practice to call die() after the redirect 
__________________
Fumigator is offline   Reply With Quote
Reply

Bookmarks

Tags
mysql, php, redirection

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:45 AM.


Advertisement
Log in to turn off these ads.