login  Naam:   Wachtwoord: 
Registreer je!
 Forum

unexpected $

Offline Wim - 14/08/2005 16:54 (laatste wijziging 14/08/2005 16:55)
Avatar van WimCrew algemeen Hallo,

Ik krijg altijd een error waar ik zelf momenteel neit aanuit kan 

Waarschijnlijk ben ik ergens iets vergeten ofzo, maarja 

Parse error: parse error, unexpected $ in /opt/lampp/htdocs/admins/index.php on line 217

lijn 217 bestaat trouwens niet

  1. <?php
  2.  
  3. $users = array("jeroenvanvooren");
  4. $passwords = array("jeroenvanvooren" => "**************");
  5.  
  6. if(!isset($_REQUEST['password']) && !isset($_REQUEST['username'])) {
  7. die ("<br><br><br><table width=\"300\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#FFFFFF\" align=\"center\" valign=\"midle\"><tr><td><fieldset><legend>Login</legend><form method=\"post\">Username: <input name=\"username\" type=\"text\" size=\"12\" maxlength=\"50\"><br>Password: <input name=\"password\" type=\"text\" size=\"12\" maxlength=\"50\"><br><input type=\"submit\" name=\"login\"></form></fieldset></td></tr></table>");
  8.  
  9. if($_REQUEST['password'] != $passwords[$_REQUEST['username']])
  10. die ("Wrong username/password!");
  11. else {
  12. $_SESSION['username'] == $_REQUEST['username'];
  13. $_SESSION['password'] == $_REQUEST['password'];
  14. header("location: index.php");
  15. }
  16.  
  17. mysql_connect("localhost", "scripting", "123");
  18. mysql_select_db($_REQUEST['username']);
  19.  
  20. if($_REQUEST['action'] == "add") {
  21. if(isset($_REQUEST['add'])) {
  22. $access = $_REQUEST['a'].$_REQUEST['b'].$_REQUEST['c'].$_REQUEST['d'].$_REQUEST['e'].$_REQUEST['f'].$_REQUEST['g'].$_REQUEST['h'].$_REQUEST['i'].$_REQUEST['j'].$_REQUEST['k'].$_REQUEST['l'].$_REQUEST['m'].$_REQUEST['n'].$_REQUEST['o'].$_REQUEST['p'].$_REQUEST['q'].$_REQUEST['r'].$_REQUEST['s'].$_REQUEST['t'].$_REQUEST['u'];
  23. mysql_query("INSERT INTO admins VALUES ('".$_REQUEST['steamid']."', '','".$acces."', 'ce')");
  24. echo ("Admin added.");
  25. }
  26. else {
  27. ?>
  28. <form method="post">
  29. <strong>ADD an admin: </strong><br>
  30. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  31. <tr>
  32. <td width="181">SteamID:</td>
  33. <td width="840">
  34. <input name="steamid" type="text" id="steamid" value="STEAM_0:">
  35. (required)
  36. </td>
  37. </tr>
  38. <tr>
  39. <td width="181">&nbsp;</td>
  40. <td>&nbsp;</td>
  41. </tr>
  42. <tr>
  43. <td width="181">Rights:</td>
  44. <td>&nbsp;</td>
  45. </tr>
  46. <tr>
  47. <td width="181"><div align="right">
  48. a
  49. <input name="a" type="checkbox" id="a" value="a">
  50. </div></td>
  51. <td>immunity (can't be kicked/baned/slayed/slaped and affected by other commmands)</td>
  52. </tr>
  53. <tr>
  54. <td width="181"><div align="right">
  55. b
  56. <input name="b" type="checkbox" id="b" value="b">
  57. </div></td>
  58. <td>reservation (can join on reserved slots)</td>
  59. </tr>
  60. <tr>
  61. <td width="181"><div align="right">
  62. c
  63. <input type="checkbox" name="checkbox3" value="checkbox">
  64. </div></td>
  65. <td>amx_kick command</td>
  66. </tr>
  67. <tr>
  68. <td width="181"><div align="right">
  69. d
  70. <input name="d" type="checkbox" id="d" value="d">
  71. </div></td>
  72. <td>amx_ban and amx_unban commands</td>
  73. </tr>
  74. <tr>
  75. <td width="181"><div align="right">
  76. e
  77. <input name="e" type="checkbox" id="e" value="e">
  78. </div></td>
  79. <td>amx_slay and amx_slap commands</td>
  80. </tr>
  81. <tr>
  82. <td width="181"><div align="right">
  83. f
  84. <input name="f" type="checkbox" id="f" value="f">
  85. </div></td>
  86. <td>amx_map command</td>
  87. </tr>
  88. <tr>
  89. <td width="181"><div align="right">
  90. g
  91. <input name="g" type="checkbox" id="g" value="g">
  92. </div></td>
  93. <td>amx_cvar command (not all cvars will be available)</td>
  94. </tr>
  95. <tr>
  96. <td width="181"><div align="right">
  97. h
  98. <input name="h" type="checkbox" id="h" value="h">
  99. </div></td>
  100. <td>amx_cfg command</td>
  101. </tr>
  102. <tr>
  103. <td width="181"><div align="right">
  104. i
  105. <input name="i" type="checkbox" id="i" value="j">
  106. </div></td>
  107. <td>amx_chat and other chat commands</td>
  108. </tr>
  109. <tr>
  110. <td width="181"><div align="right">
  111. j
  112. <input name="j" type="checkbox" id="j" value="j">
  113. </div></td>
  114. <td>amx_vote and other vote commands</td>
  115. </tr>
  116. <tr>
  117. <td width="181"><div align="right">
  118. k
  119. <input name="k" type="checkbox" id="k" value="k">
  120. </div></td>
  121. <td>access to sv_password cvar (by amx_cvar command)</td>
  122. </tr>
  123. <tr>
  124. <td width="181"><div align="right">
  125. l
  126. <input name="l" type="checkbox" id="l" value="l">
  127. </div></td>
  128. <td>access to amx_rcon command and rcon_password cvar (by amx_cvar command)</td>
  129. </tr>
  130. <tr>
  131. <td width="181"><div align="right">
  132. m
  133. <input name="m" type="checkbox" id="m" value="m">
  134. </div></td>
  135. <td>custom level A (for additional plugins)</td>
  136. </tr>
  137. <tr>
  138. <td width="181"><div align="right">
  139. n
  140. <input name="n" type="checkbox" id="n" value="n">
  141. </div></td>
  142. <td>custom level B</td>
  143. </tr>
  144. <tr>
  145. <td width="181"><div align="right">
  146. o
  147. <input name="o" type="checkbox" id="o" value="o">
  148. </div></td>
  149. <td>custom level C </td>
  150. </tr>
  151. <tr>
  152. <td width="181"><div align="right">
  153. p
  154. <input name="p" type="checkbox" id="p" value="p">
  155. </div></td>
  156. <td>custom level D </td>
  157. </tr>
  158. <tr>
  159. <td width="181"><div align="right">
  160. q
  161. <input name="q" type="checkbox" id="q" value="q">
  162. </div></td>
  163. <td>custom level E </td>
  164. </tr>
  165. <tr>
  166. <td width="181"><div align="right">
  167. r
  168. <input name="r" type="checkbox" id="r" value="r">
  169. </div></td>
  170. <td>custom level F </td>
  171. </tr>
  172. <tr>
  173. <td width="181"><div align="right">
  174. s
  175. <input name="s" type="checkbox" id="s" value="s">
  176. </div></td>
  177. <td>custom level G </td>
  178. </tr>
  179. <tr>
  180. <td width="181"><div align="right">
  181. t
  182. <input name="t" type="checkbox" id="t" value="t">
  183. </div></td>
  184. <td>custom level H </td>
  185. </tr>
  186. <tr>
  187. <td width="181"><div align="right">
  188. u
  189. <input name="u" type="checkbox" id="u" value="u">
  190. </div></td>
  191. <td>menu access </td>
  192. </tr>
  193. <tr>
  194. <td width="181">&nbsp;</td>
  195. <td>&nbsp;</td>
  196. </tr>
  197. <tr>
  198. <td width="181">&nbsp;</td>
  199. <td><input name="add" type="submit" id="add" value="Add admin!"></td>
  200. </tr>
  201. </table>
  202. </form>
  203. <?php
  204. }
  205. }
  206. /*elseif($_REQUEST['action'] == "delete") {
  207.  
  208. }
  209. elseif($_REQUEST['action'] == "edit") {
  210.  
  211. }*/
  212. else {
  213.  
  214. }
  215. ?>


Greetz,
Wim Mariën

2 antwoorden

Gesponsorde links
Offline nemesiskoen - 14/08/2005 17:00
Avatar van nemesiskoen Gouden medaille

PHP expert
je bent deze if vergeten af te sluiten, waardoor je een } tekort komt op het einde
  1. <?php
  2. if(!isset($_REQUEST['password']) && !isset($_REQUEST['username'])) {
  3. die ("<br><br><br><table width=\"300\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#FFFFFF\" align=\"center\" valign=\"midle\"><tr><td><fieldset><legend>Login</legend><form method=\"post\">Username: <input name=\"username\" type=\"text\" size=\"12\" maxlength=\"50\"><br>Password: <input name=\"password\" type=\"text\" size=\"12\" maxlength=\"50\"><br><input type=\"submit\" name=\"login\"></form></fieldset></td></tr></table>");
  4. ?>
Offline Wim - 14/08/2005 17:09
Avatar van Wim Crew algemeen ok bedankt 

had het naar if(xxxx) $opdracht willen veranderen ipv if(xxx) { $opdracht }, maar ben 1tje vergeten weg te doen omdat m'n scherm niet zover komt ;)
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2025 Sitemasters.be - Regels - Laadtijd: 0.198s