Hi everyone... Thanks alot for your help.
To bpat1434:
I could hide the mouseover thing, but it will still be written if you see the source of the site.
I found out that I don't need a 6 string code.
And btw people are logged in so they have an ID.
He's how I have done it, and it works...
First I scramble the question ID's like this.
$crypt=mysql_query("select * from Crypt WHERE ProfilID='$id'");
$count = mysql_num_rows($crypt);
$crypt=mysql_query("select * from Question ORDER BY RAND()");
$all = mysql_num_rows($crypt);
IF($count<>$all){
while ($row = mysql_fetch_array($crypt)){
$questionid=$row['QuestionID'];
mysql_query ("INSERT INTO `Crypt` (`QuizID`, `ProfilID`) VALUES ('$questionid','$id')");
}
}
Now I have the same amount of question and the same question id's but in another order written in the Crypt table.
And as long as the order is stored in Crypt it will not make another order.
Then everytime I need an ID I Join the Crypt table with the Question table.
On another page I get the correct song id from the Crypt table and plays the song:
$crypt=mysql_query("select * from Crypt WHERE CryptID='$transforid' LIMIT 1");
while ($row = mysql_fetch_array($crypt)){$questionid=$row['QuizID'];}
header("Content-Type: audio/mpeg");
readfile($questionid.".mp3");
This way every link will have the crypted id number on it, but the right song wil play without anyone being able to see the correct ID.
At last... When people click Send to submit their answers I compare the answers by decrypting the id's by joining Crypt and Question.
Count how many are correct and put it in a user table.
And then delete the crypted numbers from the Crypt table and making new ones.
mysql_query("DELETE FROM `Crypt` WHERE ProfilID=$id");
$crypt=mysql_query("select * from Question ORDER BY RAND()");
while ($row = mysql_fetch_array($crypt)){
$questionid=$row['QuestionID'];
mysql_query ("INSERT INTO `Crypt` (`QuizID`, `ProfilID`) VALUES ('$questionid','$id')");}
So when a person log in a new scramled order of the question id's is made, and it stays like this until they take the quiz.
And everytime they try the quiz a new scrambled order is made.
Very clever I think 🙂
Thanks alot for all your input...
Now I just have another little problem which you can see here.
http://phpbuilder.com/board/showthread.php?t=10341673