Unstoppable Domains

How would I go about this?

Spaceship Spaceship
Watch
Impact
0
Hi everyone.

I've recently built a site for a friends band, they've recorded a new track that they want to offer as a free download but with a twist, you have to answer 5 questions correctly (they aren't difficult but the answers can be found by visiting the sites they have in the links page, the idea is to generate a bit of traffic between the sites.....I'm not sure if people will be bothered to take the time but they're insistent they want to at least make people do something for the free song) before you're taken to the page to download the song. I was thinking something along the lines of either multiple choice answers and you have to tick the correct box, tick all 5 right and you get the free download or you type in the correct answer in a box for each question.

How would I go about this? I'm a relative novice, I can do a few graphics and piece it all together but have no idea where to start for this.

Any ideas, thanks! :)
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
.US domains.US domains
For this you would have to use the language of php, and some if commands.. Your best bet is too use radio buttons, because a typo could screw up everything...
an if command looks like:

<?php

if($var="value"){
echo("var one");
}
if($var2="value"){
echo("var 2");
}
if($var3="value"){
echo("var 3");
}
esle
{
hey
}
?>

you can visit www.tutorialized for more information on this..

Reputation is appriciated
 
0
•••
Yes PHP would be the best route to go as you could check each answer for the correct answer. Then if all 5 are right you could then forward them the page to download the song.
 
0
•••
Ok thanks, have to say I know nothing (well I know more now than I did yesterday) about PHP but I found this, it uses the $score command

http://www.indiana.edu/~istdept/R547/PHPbasics/template/template.phtml?pager=41

I copied and pasted it and managed to adapt it for what I want and deleted bits I don't need. I've got to point where I've got the "quiz" all laid out with 5 questions and multiple choice answers, and after some messing around it all works correctly, if you get 1 right it says you answered 1 correctly, get 2 right it says you answered 2 correctly, etc ,etc . Now I'm just a bit stuck in getting the final bit, i.e if you get all 5 answers correctly it comes up with the "Congrats, please click here to access the free track" or if you only get 4 right then "Bad Luck, please try again" etc etc
 
0
•••
If you could post the code that your stuck on, I'll take a look at it and see if I can't came up with a solution.
 
0
•••
<?php
$score = 0; //initialize score to zero
?>
<h3>Quiz Results</h3>
<?php
$question1 = $_POST['question1'];
$question2 = $_POST['question2'];
$question3 = $_POST['question3'];
$question4 = $_POST['question4'];
$question5 = $_POST['question5'];
echo;
?>
<?php
if ($question1 == "answer1.3")
{
$score = $score + 1;
}
else
{
}
?>
<?php
if ($question2 == "answer2.1")
{
$score = $score + 1;
}
else
{
}
?> <?php
if ($question3 == "answer3.1")
{
$score = $score + 1;
}
else
{
}
?> <?php
if ($question4 == "answer4.2")
{
$score = $score + 1;
}
else
{
}
?> <?php
if ($question5 == "answer5.3")
{
$score = $score + 1;
}
else
{
}
?>
<p>ย </p><hr>
<b>Total score:</b>You answered <?php echo ($score); ?> question(s) correctly.
?>




It's the bit at the bottom that comes after "you answered ? questions correctly. After that it would need to either say something like "Congratulations, here is your free download, click here" (if they got all 5 correct), and for anything else other than 5 right "please try again".

Thanks!
 
Last edited:
0
•••
Any ideas? :)

I tried adding this and it almost works but the opposite of what I want!! if you get 5 right then it displays all the other comments apart from the correct one "Congratulations, click here for your free download" and if you get 4 right it displays all the other comments apart the one it should be and so on and so on.

<?php
if ($score != 5)
{
echo ("Congratulations, click here for your free download");
}
?>
<?php
if ($score != 4)
{
echo ("So close, just 1 wrong, please try again.");
}
?>
<?php
if ($score != 3)
{
echo ("Bad luck, 2 wrong, please try again.");
}
?>
<?php
if ($score != 2)
{
echo ("Unlucky, 3 wrong, please try again, remember all the answers can be found in the links!");
}
?>
<?php
if ($score != 1)
{
echo ("Only 1 right, please try again, remember all the answers can be found in the links!");
}
?><?php
if ($score != 0)
{
echo ("Sorry you answered all 5 incorrectly, remember all the answers can be found in the links, please try again.");
}
?>


:'(
 
0
•••
two things:

1) use tags,
and 2) change
PHP:
!= to ==
!= means 'does not equal'
 
0
•••
Ok thanks, all sorted and fully working properly!

Cheers everyone. :)
 
0
•••
Another thing (sorry!), how would I go about tracking how many people have dowloaded an mp3. I have a few mp3's on the site and would be good to see how many times they get downloaded and have a little counter with "X number of people have downloaded this song" or something.
 
0
•••
You might want to use a session variable and a user id creation. Make them create a user id. Then use a session variable (set to true if they get all 5 right for a temp storage). Then this will limit the visitation of the download page. It will semi-password protect it. They only can access the free song if they have all 5 right. Then if they have all five right you can then change a variable on the account to true, something like song1 = true.

It would make it a bit easier. I am not sure if you want to go threw this much work or have it layed out like this. Just an idea.

Good work and good luck,
 
0
•••
TheComputerGeek247 said:
You might want to use a session variable and a user id creation. Make them create a user id. Then use a session variable (set to true if they get all 5 right for a temp storage). Then this will limit the visitation of the download page. It will semi-password protect it. They only can access the free song if they have all 5 right. Then if they have all five right you can then change a variable on the account to true, something like song1 = true.

It would make it a bit easier. I am not sure if you want to go threw this much work or have it layed out like this. Just an idea.

Good work and good luck,

Ok thanks but sounds a bit complex for a novice like me! I did say to them it's quite possible people will just give the link away and people can get it without answering the questions right. They weren't overly bothered, really the more people that download the song the better (which is why I'd like to track how many times it gets downloaded so we an see if it is being downloaded much if at all!) but hopefully it would also generate a bit of extra traffic for the sites I have in the quiz.
 
0
•••
Domain Recover
DomainEasy โ€” Live Options
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back