RSS Forums RSS
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 7730 | Replies: 12
Reply
Join Date: Sep 2004
Posts: 33
Reputation: anthmaina is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
anthmaina anthmaina is offline Offline
Light Poster

Re: syntax error, unexpected $end in ndex.php on line 127

  #11  
Mar 31st, 2007
probably there is a brace missing for an if else.
Reply With Quote  
Join Date: Sep 2008
Posts: 1
Reputation: ss_sko is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
ss_sko ss_sko is offline Offline
Newbie Poster

Re: syntax error, unexpected $end in ndex.php on line 127

  #12  
Sep 7th, 2008
hye,
i got the same error too,
its quite make me like crazy to solve it,huhuu
its said..

Parse error: syntax error, unexpected $end in C:\wamp\www\NDE_webpage(NEW)\admin_news2.php on line 154

this my php coding:

  1. <?php
  2. session_start(); //start secure part
  3.  
  4. echo $_SESSION['id'];
  5. if (!isset($_SESSION['id']))
  6. {
  7. echo "<script type='text/javascript'>window.location = 'errorlogin.htm';</script>";
  8. } //end secure part
  9. ?>
  10.  
  11. <script language="javascript" type="text/javascript" src="datetimepicker.js"></script>
  12.  
  13. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  14. <html xmlns="http://www.w3.org/1999/xhtml">
  15. <head>
  16. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  17. <title>Admin-News</title>
  18. <style type="text/css">
  19. <!--
  20. .style1 {
  21. color: #FFFFFF;
  22. font-size: medium;
  23. font-family: Arial, Helvetica, sans-serif;
  24. font-weight: bold;
  25. }
  26. .style2 {
  27. font-family: Arial, Helvetica, sans-serif;
  28. font-weight: bold;
  29. }
  30. .style3 {
  31. font-family: Arial, Helvetica, sans-serif;
  32. color: #000000;
  33. }
  34. -->
  35. </style>
  36. </head>
  37.  
  38. <body bgcolor="#CCCCCC">
  39. <table width="1100" border="0" align="center" cellpadding="0" cellspacing="0">
  40. <tr>
  41. <td colspan="2"><img src="image/header_edit_news2.jpg" width="1100" height="65"></td>
  42. </tr>
  43. <tr>
  44. <td colspan="2" bgcolor="#CC3366">&nbsp;</td>
  45. </tr>
  46. <tr>
  47. <td width="230" rowspan="2" valign="top" bgcolor="#0000FF"><table width="230" border="0" cellspacing="4" cellpadding="0">
  48. <tr>
  49. <td bgcolor="#FFFFFF">&nbsp;</td>
  50. </tr>
  51. <tr>
  52. <td bgcolor="#66CCFF">&nbsp;</td>
  53. </tr>
  54. <tr>
  55. <td bgcolor="#FFFFFF">&nbsp;</td>
  56. </tr>
  57. <tr>
  58. <td bgcolor="#66CCFF">&nbsp;</td>
  59. </tr>
  60. <tr>
  61. <td bgcolor="#FFFFFF">&nbsp;</td>
  62. </tr>
  63. </table></td>
  64. <td width="870" valign="top" bgcolor="#FFFFFF"><form id="form_add_news" name="form_add_news" method="post" action="admin_newsB.php">
  65. <table width="870" border="0" cellspacing="2" cellpadding="0">
  66. <tr>
  67. <td colspan="2" bgcolor="#6699FF"><ul>
  68. <li class="style1">Add new announcement </li>
  69. </ul></td>
  70. </tr>
  71. <tr>
  72. <td width="82" height="31" bgcolor="#E0FCEA"><span class="style2">Date</span></td>
  73. <td width="782" bgcolor="#E0FCEA"><label>
  74. <input name="news_date" type="text" id="news_date" size="22" maxlength="20">
  75. <a href="javascript:NewCal('news_date','ddmmmyyyy',true,12)"><img src="cal.gif" width="16" height="16" border="0"></a></label></td>
  76. </tr>
  77. <tr>
  78. <td height="31" bgcolor="#E0FCEA"><span class="style2">Title</span></td>
  79. <td bgcolor="#E0FCEA"><label>
  80. <input name="news_title" type="text" id="news_title" size="75" maxlength="150">
  81. </label></td>
  82. </tr>
  83. <tr>
  84. <td height="138" valign="top" bgcolor="#E0FCEA"><span class="style2">Content</span></td>
  85. <td valign="top" bgcolor="#E0FCEA"><label>
  86. <textarea name="news_content" cols="60" rows="8" id="news_content"></textarea>
  87. </label></td>
  88. </tr>
  89. <tr>
  90. <td height="24" colspan="2" valign="top"><label>
  91. <div align="right">
  92. <input type="reset" name="Reset" value="Reset">
  93. <input name="add_news" type="submit" id="add_news" value="Save">
  94. </div>
  95. </label></td>
  96. </tr>
  97. </table>
  98. </form> </td>
  99. </tr>
  100. <tr>
  101. <td height="447" valign="top" bgcolor="#FFFFFF">
  102. <form action="admin_news2.php" method="post" name="form_news_list" id="form_news_list">
  103. <table width="870" border="0" cellspacing="2" cellpadding="0">
  104. <tr>
  105. <td colspan="3" bgcolor="#6699FF"><ul>
  106. <li class="style1">List of annoucement </li>
  107. </ul></td>
  108. </tr>
  109. <tr>
  110. <td width="155" bgcolor="#FFCCCC"><strong><span class="style3">Date</span></strong></td>
  111. <td width="625" bgcolor="#FFCCCC"><strong><span class="style3">Title</span></strong></td>
  112. <td width="82" bgcolor="#FFCCCC"><strong><span class="style3">Select</span></strong></td>
  113. </tr>
  114.  
  115. <tr>
  116. <td bgcolor="#E0FCEA">
  117.  
  118. <?php
  119. $host="localhost"; // Host name
  120. $username="root"; // Mysql username
  121. $password=""; // Mysql password
  122. $db_name="nde_db"; // Database name
  123.  
  124.  
  125. mysql_connect("$host", "$username", "$password")or die("cannot connect");
  126. mysql_select_db("$db_name")or die("**** you.cannot select DB");
  127. //LINK TO THE DATBASE---------------------------------------------------->
  128. ?>
  129. <?
  130. $result = mysql_query("SELECT * FROM news_list");
  131.  
  132. //$row = mysql_fetch_array( $result );
  133.  
  134. while($row = mysql_fetch_array( $result ))
  135. {
  136. $id = $row['id'];
  137. ?>
  138. <? echo $row['date'];?></td>
  139. <td bgcolor="#E0FCEA"><a href="#?id=<?=$id?> "><? echo $row['title']; ?></a></td>
  140. <td bgcolor="#E0FCEA">&nbsp;</td>
  141. <? }?>
  142.  
  143. </tr>
  144. <tr>
  145. <td colspan="3">&nbsp;</td>
  146. </tr>
  147. </table>
  148. </form>
  149. </td>
  150. </tr>
  151. <tr>
  152. <td colspan="2" bgcolor="#CC3366">&nbsp;</td>
  153. </tr>
  154. </table>
  155. </body>
  156. </html>
Last edited by digital-ether : Sep 7th, 2008 at 9:50 am. Reason: Please surround your code with [code] ... [/code] tags
Reply With Quote  
Join Date: Sep 2005
Posts: 716
Reputation: digital-ether has a spectacular aura about digital-ether has a spectacular aura about 
Rep Power: 6
Solved Threads: 44
Moderator
digital-ether's Avatar
digital-ether digital-ether is offline Offline
Master Poster

Re: syntax error, unexpected $end in ndex.php on line 127

  #13  
Sep 7th, 2008
Try replacing your opening PHP tags with <?php instead of <?.

PHP short open tags are only available is specifically enabled in the configuration.

edit:

same for the <?= notation.
Last edited by digital-ether : Sep 7th, 2008 at 9:54 am.
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Reply With Quote  
Reply

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

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

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 10:27 am.
Newsletter Archive - Sitemap - Privacy Statement - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC