/    Sign up×
Community /Pin to ProfileBookmark

passing conditions via a cookie

I’m a complete novice seeking some help, so bear with me…I am using something called MouseLab Web that allows a researcher to conduct surveys/experiments over the web. It uses what I call an “idiot” editor, but I still don’t seem to be up to the task. The basic problem is that I seem to be lacking a certain threshold of knowledge.

To track responses, on my start page I ask the subjects to enter a subject number and condition number that should pass to the following pages (see below):

<html>
<head>
<title>Mouselab WEB</title>
<link rel=”stylesheet” href=”mlweb.css” type=”text/css”>

<script language=”javascript”>
function startExp(formlink)
{
// enter the pagename of the MouselabWEB page below
linkstr = “page1exp1.html”;

// get values from form
subject = formlink.subject.value;
condnum=parseInt(formlink.condnum.value);

// set cookies
document.cookie=”mlweb_condnum=”+condnum+”; path=/”;
document.cookie=”mlweb_subject=”+subject+”; path=/”;

AND on the next linked page I have the following code (and in every linked page thereafter except for the final “thank you” page):

<!–these will be set by the script –>
<input type=hidden name=”subject” value=”<?echo($subject)?>”>
<input type=hidden name=”condnum” value=”<?echo($condnum)?>”>

BUT, when I test the series of linked pages, the e-mailed results via form mailer show this in the subject line:

MouselabWEB data exp=exp1, subj=<?echo($subject)?>

Any suggestions to what I’m doing wrong? What I need to happen is that I need to get the subject number from form to form and into the e-mail subject line. Any help is appreciated.

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @MountaineerScot spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...