Welcome, Guest
Username: Password: Remember me

TOPIC: LimeSurvey variables in custom phpscript

LimeSurvey variables in custom phpscript 3 years 4 months ago #58081

  • pelle
  • pelle's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 15
  • Thank you received: 1
  • Karma: 1
Imagine an empty phpscript: "<?php ?>" How can I get hold of the values of variables like $surveyid in a custom phpscript like that? What do I need to load before I can use those variables? How can I load the $_session for instance?
The administrator has disabled public write access.

Re: LimeSurvey variables in custom phpscript 3 years 4 months ago #58105

  • pelle
  • pelle's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 15
  • Thank you received: 1
  • Karma: 1
or is it easier to reach those values with javascript? How? And which variables can I reach? I would need the {SGQ} or the questionid and further some variable dealing with the userid.
The administrator has disabled public write access.

Re: LimeSurvey variables in custom phpscript 3 years 4 months ago #58106

  • pelle
  • pelle's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 15
  • Thank you received: 1
  • Karma: 1
Should explain what I am after:
I have implemented flash applications in a number of Text Display type questions. Now, these flashapps are supposed to deliver data to the database. For that reason I created a custom db table to store data from the flashapps. I transfer data from the flash to the database via a phpscript wich is called from the flashapp. It works fine. The problem is as follows; I would like to pick up the questioncode, i.e. the value of {SGQ} and the id of the user on the way to the database from my phpscript. Alternatively I could pick those values up when I load the flashapp in the question htmlcode, but I dont succeed doing that either. Help me before I go insane ;-D
The administrator has disabled public write access.

Re: LimeSurvey variables in custom phpscript 3 years 4 months ago #58256

  • pelle
  • pelle's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 15
  • Thank you received: 1
  • Karma: 1
Solved
The administrator has disabled public write access.

Re: LimeSurvey variables in custom phpscript 3 years 2 months ago #60867

  • madopr
  • madopr's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 26
  • Karma: 0
Can you tell us how you solved it?
The administrator has disabled public write access.

Re: LimeSurvey variables in custom phpscript 3 years 2 months ago #60869

  • pelle
  • pelle's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 15
  • Thank you received: 1
  • Karma: 1
The surveyid and questionid I sent to the flash while loading it using "?" and a string which sets the variables in flash. Example: "tonal.swf?sid=92861&qid=5". Thats no news really. The only variable I couldnt get that way was the token id because it will be unique for every user at runtime. So I picked it up on the way from the flash to the db in a custom phpscript. After some code to get through the safety this line loads the tokenid into the variable $token:
$token = $_SESSION;
The administrator has disabled public write access.
The following user(s) said Thank You: madopr

Re: LimeSurvey variables in custom phpscript 3 years 2 months ago #60873

  • madopr
  • madopr's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 26
  • Karma: 0
ok, thanks!!
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.119 seconds
Donation Image