User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,488 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,733 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1589 | Replies: 2
Reply
Join Date: Feb 2006
Posts: 104
Reputation: mesamb1 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
mesamb1's Avatar
mesamb1 mesamb1 is offline Offline
Junior Poster

Troubleshooting Annoying T_Variable error

  #1  
Dec 27th, 2006
I am new to PHP and I am trying to create an application for a friend with a good sense of humor, the app takes quotes and randimly loads one when the page is loaded. I had no idea how to do it so I took some coading for a blackjack shuffle program and pluged in what i wanted. It worked for a little while and then I tried to add some more quotes and got an error that I cant explain. the code looks like it is right but I keep getting the error:

Parse error: syntax error, unexpected T_VARIABLE in
/home/.aspen/mesamb1/sultanofmirth.com/every/quotes.php on line 142

line 142 is
  1. $face = array_rand($names) ;
I hope some one know what my problem is!
here is all of my program:
  1. <?php
  2.  
  3. $names["that kneeds to be looked at!"] = "1";
  4. $names["Thanks, Abhit! Support from viewers like you would help create more humor you know"] ="1";
  5. $names["knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee knee"] ="1";
  6. $names[me] ="1";
  7. $names["> 10 PRINT 'knee ' > 20 GOTO 10"] ="1";
  8. $names["kneel"] ="1";
  9. $names["tear out my fingernails"] ="1";
  10. $names["Yes."] ="1";
  11. $names["http://www.bebosoft.com/pr
  12. oducts/qipo/
  13.  
  14. i have it"] ="1";
  15. $names["I get rss of the comments.
  16.  
  17. rolleyes"] ="1";
  18. $names["http://reyner.be/files/hat
  19. s.jpg"] ="1";
  20. $names["H-E-Double Hockey Sticks works too."] ="1";
  21. $names["One time I was in a car, the mom of a friend driving, and she was all, 'This is the parking lot from H-E-Double Hockey Sticks!!'"] ="1";
  22. $names["I'M GEORGE ZIMMER. YOU'RE
  23. GONNA LIKE THE WAY YOU LOOK.
  24. I GUARANTEE IT."] ="1";
  25. $names["Mr. Bhandari!
  26. Satisfactory Christmas?
  27. I sure hope it was!"] ="1";
  28. $names["MY GERMAN-FRENCH BEEF BOURGUIGNON WAS BETTER! THERE WERE TRADITIONAL GERMAN NOODLES.
  29.  
  30. sorry"] ="1";
  31. $names["my about me has the text
  32.  
  33. just hand that to Peyton Miller"] ="1";
  34. $names["OK, I know I've been sending you a lot of links, but this one is SO GOOD. I want to have it engraved on my tombstone. Seriously, don't miss this one. This is one we need to show Peyton, and get him to memorize and recite on a bi-hourly basis.
  35.  
  36. Here it is.
  37. http://religionandpolitics
  38. .ytmnd.com/"] ="1";
  39. $names["http://www.encyclopediadra
  40. matica.com/ind
  41. ex.php/Image:Zimmer-tapest
  42. ry.jpg"] ="1";
  43. $names["Thanks for looking at them. I'm glad you liked the paris hilton one (guess what it inspired), but my favorites are cosby cosby and CORN ONNNNNN THE COBBBBBBB"] ="1";
  44. $names["http://cornonthekabob.ytmn
  45. d.com/"] ="1";
  46. $names["http://buttonz.ytmnd.com/"] ="1";
  47. $names["http://cosbycosby.ytmnd.co
  48. m/"] ="1";
  49. $names["sorry i keep on sending you these but
  50. http://lootasnickers.ytmnd
  51. .com/"] ="1";
  52. $names["http://conanmagnified.ytmn
  53. d.com/"] ="1";
  54. $names["http://parisfacial.ytmnd.c
  55. om/"] ="1";
  56. $names["http://www.lyrics007.com/G
  57. ang%20Sugarhil
  58. l%20Lyrics/Apache%20Lyrics
  59. .html
  60.  
  61. you're right: that is REALLY racist"] ="1";
  62. $names["HA HA HA HA HA!
  63. I have to concede; you win.
  64. Congratulations."] ="1";
  65. $names["Thank you very much.
  66. That took a little longer
  67. Than I would have liked."] ="1";
  68. $names["Abhit Bhandari
  69. In Scholars' Bowl or elsewhere
  70. Always makes me laugh?"] ="1";
  71. $names["I would like to see
  72. Mr. Abhit Bhandari
  73. Play the Piano
  74.  
  75. haiku, son"] ="1";
  76. $names["someone should file a police report.
  77.  
  78. I'll do it i guess"] ="1";
  79. $names["http://reyner.be/files/wha
  80. t.gif
  81.  
  82. I don't really get what that is. He pulled it out of nowhere!"] ="1";
  83. $names["ok, the 3 stories tonight were
  84.  
  85. 1. the main competetor to Barbie
  86. 2. going on the journey that Joseph and Mary went on today
  87. and
  88. 3. people employed in the UK to help men buy lingerie for their wives
  89.  
  90. this is news."] ="1";
  91. $names["I wouldn't— they have an old iranian talking about 'a passion for fashion.' what the hell"] ="1";
  92. $names["they're doing a thing on challenges to barbie!?
  93.  
  94. http://reyner.be/files/emo
  95. t-raise.gif"] ="1";
  96. $names["that's 19, but I'm not updating the gif: nightline comes on at 11:35. To the radio!
  97.  
  98. From the global resources of ABC News, with Terry Moran in Washington, and Martin Bashir and Cynthia McFadden in Times Square, New York, this is 'Nightline.' December 22, 2006."] ="1";
  99. $names["HA HA
  100. http://reyner.be/files/mad
  101. money6.mov"] ="1";
  102. $names["http://reyner.be/files/hah
  103. a.gif"] ="1";
  104. $names["I like to read what people write to each other. I guess you could call me a Wall-to-Wall Charlatan.
  105. "] ="1";
  106. $names["not to mention the number of times over AIM..."] ="1";
  107. $names["You've written 'haha' or some variant thereof on my wall 17 times!
  108.  
  109. I guess I'm funny."] ="1";
  110. $names["http://reyner.be/files/bob
  111. ble.gif"] ="1";
  112. $names["oh yeah and roland suggested I start the 'Kids Against Murder and Gravity' club :D"] ="1";
  113. $names["2 things:
  114. 1. http://en.wikipedia.org/wi
  115. ki/Image:Crame
  116. rchair.gif
  117. 2. Apparently my parents' answering machine message used to be the following:
  118.  
  119. 'We can't come to the phone right now. Our dog would answer it, but alas, he doesn't have thumbs.'"] ="1";
  120. $names["man, didn't see your status, but I was only a couple hours late!"] ="1";
  121. $names["Harry Potter and the Deathly Hallows!"] ="1";
  122. $names["http://reyner.be/files/sel
  123. l.aif
  124.  
  125. but not cisco, Cramer loves cisco"] ="1";
  126. $names["http://www.comedycentral.c
  127. om/sitewide/me
  128. dia_player/play.jhtml?item
  129. Id=79579"] ="1";
  130. $names["Do you know who John Chambers is?
  131.  
  132. He's been mentioned on the Mad Money Lightning Round at least 3 times now since 12/5/06..."] ="1";
  133. $names["I just saw the Harry Potter and the OotP trailer today..."] ="1";
  134. $names["I changed my ringtone to http://reyner.be/files/toy
  135. s.mp3"] = "1"
  136.  
  137. $face = array_rand($names) ;
  138.  
  139. echo "Reyner's mememorable facebook Quote (refresh for more!): $face" ;
  140.  
  141.  
  142. ?>
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2006
Location: India
Posts: 6
Reputation: PeppySoft is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
PeppySoft PeppySoft is offline Offline
Newbie Poster

Re: Annoying T_Variable error

  #2  
Dec 27th, 2006
Use
$face = array_rand($names);

instead of

$face = array_rand($names) ;

You are using a <SPACE> after the array_rand() function
Reply With Quote  
Join Date: Feb 2006
Posts: 104
Reputation: mesamb1 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
mesamb1's Avatar
mesamb1 mesamb1 is offline Offline
Junior Poster

Solution Re: Annoying T_Variable error

  #3  
Dec 27th, 2006
Thanks for the help!! though that sent me on the right path it didn't fix it. the problem was I did not put a ; on the line above!! thanks again
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 3:12 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC