TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 195,994
  • Total Topics: 21,325
  • Online today: 348
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 312
  • Total: 312

Code Error

Started by deadpoeticstar, May 04, 2006, 04:05:14 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

deadpoeticstar

$text[0]="Why do we park on driveways and drive on parkways?" <strong>Unknown</strong;
$text[1]="If you have webbed feet are you a duck? Or do you have to quack too?" <strong>Chris Little</strong>";
$text[2]="Do gooder than you done before. You never know when your goodest may be the bestest." <strong>Chris Little</strong>";
$text[3]="If a tree falls in the forest and no one is there to hear it - does it make a sound? Who cares, I can download it onto my ipod!!!" <strong>Chris Little</strong>";
$text[4]="Who decided that 2+2=4? Why can we not change the equations if all the numbers were made up by some guy way back when?" <strong>Chris Little</strong>";
$text[5]="If at first you don't succeed, try again. Then quit. There's no use being a damn fool about it." <strong>W.C. Fields</strong>";
$text[6]="The real reason that we can't have the Ten Commandments in a courthouse: You cannot post "Thou shalt not steal", Thou shalt not commit adultery" and "Thou shalt not lie" in a building full of lawyers, judges and politicians. It creates a hostile work environment." <strong>George Carlin</strong>";
$text[7]="We love violence in this country, we love violence. We all have those little violent tendencies. I know you're like me, when you see someone walking down the street in a Superman tee shirt, you just want to shoot them in the chest. And when they start to bleed go, "I guess not." Don't wear the shirt. Wear a shirt that says, "I bleed if you shoot me in the chest plate" and I will not shoot you in the chest plate, Superbleeder. Haha I called him Superbleeder." <strong>Dane Cook</strong>
$text[8]="Here's an example of a women who was too optimistic with me recently. I was walking by a shoe store, and I looked in the window, and I see a pair of boots that I want in my life, OK so I walk in and I say to the women working there "Hi, excuse me. Hey, do you have these boots in a 12?" this is what she does, she looks at me very optimistically and goes "ummm let me take a peek" That's what she said by the way, "let me take a peek" I'm like "yeah while your at it, look around don't just glimpse, I want these boots..move a box if you have to" She goes into the back, when she comes out shes super optimistic and shes holding a boot she walks right up to me and says '..we have it in a 9!!' "Really? do you guys also have a bone saw anywhere near by? Tell you what, just run at me really fast and jam that sucker right on my hoof. Do you guys have a time machine to send me back to the 7th grade when those fit my feet?"
<strong>Dane Cook</strong>
$text[9]="I got a new slogan, If something happens in Vegas and I see it, I'm fucking telling everybody" <strong>Dane Cook</strong>
function show_rand_quotes($text) {
    mt_srand((double)microtime()*1000000);
    $rand=mt_rand() % sizeof($text);
    echo $text[$rand];
}


That is a script i found. i put it in a php box but then i also have this:

echo "Random quote for is: ".show_rand_quotes($text);

how do i need to get this set up so it does set up for the PHP block

and this is what the error message says:

Parse error: parse error, unexpected '>' in /home/georgeli/public_html/smf/Sources/Load.php(1609) : eval()'d code(34) : eval()'d code on line 1

IchBin

#1
Try this:
$text[0]="Why do we park on driveways and drive on parkways? <strong>Unknown</strong>";
$text[1]="If you have webbed feet are you a duck? Or do you have to quack too? <strong>Chris Little</strong>";
$text[2]="Do gooder than you done before. You never know when your goodest may be the bestest. <strong>Chris Little</strong>";
$text[3]="If a tree falls in the forest and no one is there to hear it - does it make a sound? Who cares, I can download it onto my ipod!!! <strong>Chris Little</strong>";
$text[4]="Who decided that 2+2=4? Why can we not change the equations if all the numbers were made up by some guy way back when? <strong>Chris Little</strong>";
$text[5]="If at first you don't succeed, try again. Then quit. There's no use being a damn fool about it. <strong>W.C. Fields</strong>";
$text[6]="The real reason that we can't have the Ten Commandments in a courthouse: You cannot post \"Thou shalt not steal\", Thou shalt not commit adultery\" and \"Thou shalt not lie\" in a building full of lawyers, judges and politicians. It creates a hostile work environment. <strong>George Carlin</strong>";
$text[7]="We love violence in this country, we love violence. We all have those little violent tendencies. I know you're like me, when you see someone walking down the street in a Superman tee shirt, you just want to shoot them in the chest. And when they start to bleed go, \"I guess not.\" Don't wear the shirt. Wear a shirt that says, \"I bleed if you shoot me in the chest plate\" and I will not shoot you in the chest plate, Superbleeder. Haha I called him Superbleeder. <strong>Dane Cook</strong>";
$text[8]="Here's an example of a women who was too optimistic with me recently. I was walking by a shoe store, and I looked in the window, and I see a pair of boots that I want in my life, OK so I walk in and I say to the women working there \"Hi, excuse me. Hey, do you have these boots in a 12?\" this is what she does, she looks at me very optimistically and goes \"ummm let me take a peek\" That's what she said by the way, \"let me take a peek\" I'm like \"yeah while your at it, look around don't just glimpse, I want these boots..move a box if you have to\" She goes into the back, when she comes out shes super optimistic and shes holding a boot she walks right up to me and says '..we have it in a 9!!' \"Really? do you guys also have a bone saw anywhere near by? Tell you what, just run at me really fast and jam that sucker right on my hoof. Do you guys have a time machine to send me back to the 7th grade when those fit my feet? <strong>Dane Cook</strong>";
$text[9]="I got a new slogan, If something happens in Vegas and I see it, I'm fucking telling everybody <strong>Dane Cook</strong>";
function show_rand_quotes($text) {
    mt_srand((double)microtime()*1000000);
    $rand=mt_rand() % sizeof($text);
    echo $text[$rand];
}

deadpoeticstar

Parse error: parse error, unexpected T_STRING in /home/georgeli/public_html/smf/Sources/Load.php(1609) : eval()'d code(34) : eval()'d code on line 7

IchBin

Edited the text above. I forgot to escape some characters. I'm no PHP guru, but thats the way I think it should look.

deadpoeticstar

lol the box shows but there is nothing in it now...lol

bloc

#5
try this one:
$text[0]='"Why do we park on driveways and drive on parkways?" <strong>Unknown</strong';
$text[1]='"If you have webbed feet are you a duck? Or do you have to quack too?" <strong>Chris Little</strong>';
$text[2]='"Do gooder than you done before. You never know when your goodest may be the bestest." <strong>Chris Little</strong>';
$text[3]='"If a tree falls in the forest and no one is there to hear it - does it make a sound? Who cares, I can download it onto my ipod!!!" <strong>Chris Little</strong>';
$text[4]='"Who decided that 2+2=4? Why can we not change the equations if all the numbers were made up by some guy way back when?" <strong>Chris Little</strong>';
$text[5]='"If at first you don\'t succeed, try again. Then quit. There\'s no use being a damn fool about it." <strong>W.C. Fields</strong>';
$text[6]='"The real reason that we can\'t have the Ten Commandments in a courthouse: You cannot post "Thou shalt not steal", Thou shalt not commit adultery" and "Thou shalt not lie" in a building full of lawyers, judges and politicians. It creates a hostile work environment." <strong>George Carlin</strong>';
$text[7]='"We love violence in this country, we love violence. We all have those little violent tendencies. I know you\'re like me, when you see someone walking down the street in a Superman tee shirt, you just want to shoot them in the chest. And when they start to bleed go, "I guess not." Don\'t wear the shirt. Wear a shirt that says, "I bleed if you shoot me in the chest plate" and I will not shoot you in the chest plate, Superbleeder. Haha I called him Superbleeder." <strong>Dane Cook</strong>';
$text[8]='"Here\'s an example of a women who was too optimistic with me recently. I was walking by a shoe store, and I looked in the window, and I see a pair of boots that I want in my life, OK so I walk in and I say to the women working there "Hi, excuse me. Hey, do you have these boots in a 12?" this is what she does, she looks at me very optimistically and goes "ummm let me take a peek" That\'s what she said by the way, "let me take a peek" I\'m like "yeah while your at it, look around don\'t just glimpse, I want these boots..move a box if you have to" She goes into the back, when she comes out shes super optimistic and shes holding a boot she walks right up to me and says \'..we have it in a 9!!\' "Really? do you guys also have a bone saw anywhere near by? Tell you what, just run at me really fast and jam that sucker right on my hoof. Do you guys have a time machine to send me back to the 7th grade when those fit my feet?"
<strong>Dane Cook</strong>';
$text[9]='"I got a new slogan, If something happens in Vegas and I see it, I\'m fucking telling everybody" <strong>Dane Cook</strong>';


    mt_srand((double)microtime()*1000000);
    $rand=mt_rand() % sizeof($text);
    echo $text[$rand];


I am more found of single than double quotes. :)

EDIT: removed the function..it can just show at once.

deadpoeticstar

#6
lol gave me another parsing error :P

Parse error: parse error, unexpected T_STRING in /home/georgeli/public_html/smf/Sources/Load.php(1609) : eval()'d code(34) : eval()'d code on line 6

if it helps i got the script from Here

G6Cad


deadpoeticstar

well i tried but i couldnt get it to set up...proboably cause i had a brain fart...but ill try again

IchBin

Make sure you delete everything, and copy/paste the exact code that Bloc posted because it works on mine mate.

This website is proudly hosted on Crocweb Cloud Website Hosting.