Jump to content


Photo

T_LNUMBER, expecting ')'


  • Please log in to reply
11 replies to this topic

#1 Pixeled Ink

Pixeled Ink
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 10 June 2006 - 06:25 PM

Hi, I am using a script from [a href=\"http://regretless.com/scripts/\" target=\"_blank\"]Dodo's Scripts[/a]. (See '- Dodos Quiz Script Version 1.0')
I am having a problem when I try to visit the page. If I go to this address> [a href=\"http://pixeled-ink.plastictokyo.net/indirect/wyds.php?n=1\" target=\"_blank\"]http://pixeled-ink.plastictokyo.net/indirect/wyds.php?n=1[/a] and all I get is this [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Parse error: parse error, unexpected T_LNUMBER, expecting ')' in /home3/plae8776/public_html/pixeled-ink/indirect/wyds.php on line 71
[/quote] I fixed the last problem, but this one stumps me.


Here is the script I used/edited:
<?php
/****************************************************
// Dodo's Quiz Script
// Copyrighted by Ying Zhang
// http://regretless.com/scripts
// No redistribution without authorization
// Script released under linkware
// that means LINK ME if you use it for your website
/****************************************************/

/********************************************************************************
Remember if you name this file quiz_1.php it will be quiz no. 1!
You will have to call this script by using
quiz.php?n=1
*********************************************************************************/
// Would you like to get get an email when someone takes this particular quiz?
$email_notify = 1;  // 1 = yes 0 = no
// if so
$admin_email = "p-i_staff@plastictokyo.net";

// Your quiz question:
$quiz_question = "What is your dolling style?";

// What you want your submit button to say?
$submit_button = "Am I really that goth?";

// Your quiz description:
$quiz_description = "This is a quiz that determines your dolling style!";

// Do you want to make sure that all of your questions are answered before the results are calculated?
$all_questions_answer = 1; // 1 = yes 0 = no

// Now for each result, give it a description. Please make sure you put \ in front your quotations or you will get parse error!
// Put them as the result name => result description
// For example: "not_the_one" => "You are definitely not the one for Dodo. Too bad :(";
// WARNING: it's always possible to get the same two results so watch the order of these.
$results_array = array(
1 => "<div class=\"header\">You are totally GOTH</div><div class=\"just\">You have the spikes and the chains, what more is there?<br /><br />Goth is your dolling style. Usually using blacks and greys, you make your dolls have an edge. Could be vampires or zombies, you always have dolls with a light complexion. Spooky!</div>",
2 => "<div class=\"header\">Prep much!</div><div class=\"just\">You are the preppy type, with pinks and blues, making your dolls the more 'popular' ones in school.<br /><br />Ahead cheerleader, or head of the school Varsity team, you never know because you are pink and perfect! </div>",
3 => "<div class=\"header\">Sporty and fun!</div><div class=\"just\">Your dolls are full of bright colours, like orange or red! Making them just that much more fun!<br /><br />With such spunky colours, who could resist loving your creations?!</div>",
4 => "<div class=\"header\">Earthen and warm.</div><div class=\"just\">Your dolls are full of colours like browns and soft greens.<br /><br />In a nice environment, your dolls are always comfurtable. They are in touch with mother nature, and always seem calm or friendly. Your dolling style is cool and lovely.</div>",
5 => "<div class=\"header\">Crazy creations!</div><div class=\"just\">Your dolls are always wearing something like spots or stripes, with bright colours everywhere!<br /><br />Probably in the time era on 1970, your dolls have platforms boots, or big hair. Always fun, and funky, they bring smiles to everyone's faces! </div>",
);

// Now your questions
$questions_array = array(
1=> "Which of these colours appeals to you more when you doll?",
2=> "Which of these accessories is most likely to be used on one of your dolls?",
3=> "Which type of shoe do your dolls usually have on?",
4=> "Where would your dolls hang out if they were real?",
5=> "What kinds of contests do you usually enter your dolls in? (If you don't enter contests, which kinds would you if you did?)",
6=> "What is your doll's favourite food?",
7=> "Which of these colours is least likely to be found on one of your dolls?",
8=> "If you were to have an animal as an accessory with one of your dolls, which of these might you use?",
9=> "Last but not least, what facial expressions do your dolls usually have?",
);

// your answers. MAKE SURE it's the same order as the questions. also gives which of the results is the answer corresponding to separated by the symbol |. One unique answer per line!

$answers_array = array(
1=> "Red|3
Pink|2
Black|1
Rainbow|5
Green|4",
// above will print as answers
// 1. Blue (this corresponds to not the one)
// 2. Red (not the one)
// 3. Pink (sorta)
// 4. Rainbow (the one)
2=> "Purse or dog carrier|2)
Chains and spike collars|1
A book|4
Fake eyelashes|5
Wide sun hat|3",
// above will print as answers
// 1. Spring (sorta)
// 2. Summer (not the one)
// 3. Fall (the one)
// 4. Winter (not the one)
3=> "Dark in colour with a chunky heel|1
Sandals or bare feet|4
Sneakers|3
Platforms|5
Cute High heels|2",
4=> "Malt Shoppe|2
A Dark Alley|1
The Beach|3
A Retro Store|5
The Forest|4",
5=> "Retro|5
Pretty 'n Pink|2
Vampires|1
Casual|3
Hippees|4",
6=> "Chocolate|2
Veggies|4
Something Wacky|5
Food with names like eyeball stew|1
Squid|3",
7=> "black|2
orange|4
none|5
grey|3
pinks 'n purples|1",
8=> "Chiwawa|2
Raven|1
Cat|4
Dragon|3
Rat|5",
9=> "Grouchy, not very nice|1
A sweet, pert smile|2
Large grin|3
Shy|4
Tongue-out|5",

/*******************************************
 I hope you get the idea now.
 Just add more if you have more questions.
 Make sure to change the index numbers.
 For example, the next one should begin with
 3=> "blah|1
 blah|2
 blah|3",
 always end with a quotation and a comma!
 *******************************************/

);

######### END OF QUIZ 1 DATA ##################################################
?>


#2 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 10 June 2006 - 06:29 PM

if you read the error you will see you are missing a ) somewhere around line 71 and anyways how can anybody help you if you don't post any code

in your arrays, at the end of 5 => and 9 => there is a comma. take them out. it's expecting another key => value but you have blah, ); so it's expecting a ) not a ,
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#3 Pixeled Ink

Pixeled Ink
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 10 June 2006 - 06:30 PM

I did post my code..

#4 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 10 June 2006 - 06:30 PM

Actually he is missing a comma.

Look at your $answers_array, after the first element there is no comma.
~ D Kuang

#5 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 10 June 2006 - 06:33 PM

sorry. you edited your post to include your code. i posted before you did that.
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#6 Pixeled Ink

Pixeled Ink
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 10 June 2006 - 06:35 PM

ahh, alright.. lol I changed the comma, added it..whatever, and now once I click the link, the page loads, but it is blank...?..Here, I will change my code from before to what it is now

#7 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 10 June 2006 - 06:36 PM

well that script doesn't actually do anything but hold data in some arrays. you have to make a script that actually does something with it.
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#8 Pixeled Ink

Pixeled Ink
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 10 June 2006 - 06:38 PM

hmmm...like I said, it's not mine..just a script I adopted. It was meant to be a quiz..does anyone know a better script for a radio-button quiz? (I suck at making my own coding, and I dont want it to take forever, I dont have that much time :P)

edit: Wait a second! I just realized that you are right..I wasn't getting it before, but I need to put in things like radio buttons and stuff for it to work! I'm a total dunce!

#9 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 10 June 2006 - 06:45 PM

well from the looks of it, at the beginning of this script, shouldn't you have another file called quiz.php that actually uses this script?
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#10 Pixeled Ink

Pixeled Ink
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 10 June 2006 - 06:50 PM

yes, that's what I am going to go do now :) thanks for your help...lol I guess putting it out there just made me realize what I was missing

#11 joquius

joquius
  • Members
  • PipPipPip
  • Advanced Member
  • 319 posts

Posted 10 June 2006 - 06:55 PM

Here:

$q = Array
(
  [0] = Array
  (
    [0] = "How are you";
    [1] = "2";
    [2] = "Fine";
    [3] = "Rubbish";
  )
)

if (isset ($_POST['submit_q']))
{
  foreach ($_POST as $field => $answer)
  {
    if ($answer > 1)
    {
      $a = explode ("_", $field);
      $answer[$a[0]] = ($q[$a[0]][1] == $answer) ? 1 : 0
     }
  }
}

?><form action="?submit" method="post" name="submit_q"><?
foreach ($q as $question => $data)
{
  echo $data[0]."<br>";
  foreach ($data as $code => $data)
    if ($code > 1)
    {
      ?><input type="radio" name="<?=$question?>_question" value="<?=$code?>"><?=$data?><br><br>
    }
  }
}
?>
<input type="submit" name="submit_q" vlaue="submit">
</form>

may need some clean up work. just echo the $answer result on the page if it's set and then answer is true if $answer = 1;
z..z..z..z..z..z..z..z..

#12 Pixeled Ink

Pixeled Ink
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 10 June 2006 - 07:23 PM

Thanks everyone! It's working now! Here is the coding I used to make it work:
<HTML>
<HEAD>
<TITLE>What's Your Dolling Style?</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="style.css">
</HEAD>
<BODY BGCOLOR=#B1833D bgproperties="fixed">
 <div id="Content">
    <div class="header">What's Your Dolling Style?</div>
<div class="just">This is a quiz that determines your dolling style!</div><form 

action="quiz_1.php?n=1&action=results" method="post"><div class="rings">Which of these colours 

appeals to you more when you doll?</div>
<div class="just">
<input type="radio" name="choices[1]" value="3">Red<br /> 
<input type="radio" name="choices[1]" value="2">Pink<br /> 
<input type="radio" name="choices[1]" value="1">Black<br /> 
<input type="radio" name="choices[1]" value="5">Rainbow<br /> 
<input type="radio" name="choices[1]" value="4">Green<br /> 
</div><br />
<div class="rings">Which of these accessories is most likely to be used on one of your dolls?</div>
<div class="just">
<input type="radio" name="choices[2]" value="2">Purse or dog carrier<br /> 
<input type="radio" name="choices[2]" value="1">Chains and spike collars<br /> 
<input type="radio" name="choices[2]" value="4">A book<br /> 
<input type="radio" name="choices[2]" value="5">Fake eyelashes<br /> 
<input type="radio" name="choices[2]" value="3">Wide sun hat<br />
</div><br />
<div class="rings">Which type of shoe do your dolls usually have on?</div>
<div class="just">
<input type="radio" name="choices[3]" value="1">Dark in colour with a chunky heel<br /> 
<input type="radio" name="choices[3]" value="4">Sandals or bare feet<br /> 
<input type="radio" name="choices[3]" value="3">Sneakers<br /> 
<input type="radio" name="choices[3]" value="5">Platforms<br /> 
<input type="radio" name="choices[3]" value="2">Cute High heels<br /> 
</div><br />
<div class="rings">Where would your dolls hang out if they were real?</div>
<div class="just">
<input type="radio" name="choices[4]" value="2">Malt Shoppe<br /> 
<input type="radio" name="choices[4]" value="1">A Dark Alley<br /> 
<input type="radio" name="choices[4]" value="3">The Beach<br /> 
<input type="radio" name="choices[4]" value="5">A Retro Store<br /> 
<input type="radio" name="choices[4]" value="4">The Forest<br /> 
</div><br />
<div class="rings">What kinds of contests do you usually enter your dolls in? (If you don't enter 

contests, which kinds would you if you did?)</div>
<div class="just">
<input type="radio" name="choices[5]" value="5">Retro<br /> 
<input type="radio" name="choices[5]" value="2">Pretty 'n Pink<br /> 
<input type="radio" name="choices[5]" value="1">Vampires<br /> 
<input type="radio" name="choices[5]" value="3">Casual<br /> 
<input type="radio" name="choices[5]" value="4">Hippees<br /> 
</div><br />
<div class="rings">What is your doll's favourite food?</div>
<div class="just">
<input type="radio" name="choices[6]" value="2">Chocolate<br /> 
<input type="radio" name="choices[6]" value="4">Veggies<br /> 
<input type="radio" name="choices[6]" value="5">Something Wacky<br /> 
<input type="radio" name="choices[6]" value="1">Food with names like eyeball stew<br /> 
<input type="radio" name="choices[6]" value="3">Squid<br /> 
</div><br />
<div class="rings">Which of these colours is least likely to be found on one of your dolls?</div>
<div class="just">
<input type="radio" name="choices[7]" value="2">black<br /> 
<input type="radio" name="choices[7]" value="4">orange<br /> 
<input type="radio" name="choices[7]" value="5">none<br /> 
<input type="radio" name="choices[7]" value="3">grey<br /> 
<input type="radio" name="choices[7]" value="1">pinks 'n purples<br /> 
</div><br />
<div class="rings">If you were to have an animal as an accessory with one of your dolls, which of 

these might you use?</div>
<div class="just">
<input type="radio" name="choices[8]" value="2">Chiwawa<br /> 
<input type="radio" name="choices[8]" value="1">Raven<br /> 
<input type="radio" name="choices[8]" value="4">Cat<br /> 
<input type="radio" name="choices[8]" value="3">Dragon<br /> 
<input type="radio" name="choices[8]" value="5">Rat<br /> 
</div><br />
<div class="rings">If you were to have an animal as an accessory with one of your dolls, which of 

these might you use?</div>
<div class="just">
<input type="radio" name="choices[9]" value="1">Grouchy, not very nice<br /> 
<input type="radio" name="choices[9]" value="2">A sweet, pert smile<br /> 
<input type="radio" name="choices[9]" value="3">Large grin<br /> 
<input type="radio" name="choices[9]" value="4">Shy<br /> 
<input type="radio" name="choices[9]" value="5">Tongue-out<br /> 
</div><br />
<input type="submit" value="Am I Really That Goth?" class="form"></form><div>Quiz made 

possible with <a href="http://regretless.com/scripts/" target="_blank">Dodo's Quiz 

Script</a></div></div>

<p><br><br>
</BODY>
</HTML>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users