Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 7730 | Replies: 12
![]() |
•
•
Join Date: Sep 2008
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
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:
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:
php Syntax (Toggle Plain Text)
<?php session_start(); //start secure part echo $_SESSION['id']; if (!isset($_SESSION['id'])) { echo "<script type='text/javascript'>window.location = 'errorlogin.htm';</script>"; } //end secure part ?> <script language="javascript" type="text/javascript" src="datetimepicker.js"></script> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Admin-News</title> <style type="text/css"> <!-- .style1 { color: #FFFFFF; font-size: medium; font-family: Arial, Helvetica, sans-serif; font-weight: bold; } .style2 { font-family: Arial, Helvetica, sans-serif; font-weight: bold; } .style3 { font-family: Arial, Helvetica, sans-serif; color: #000000; } --> </style> </head> <body bgcolor="#CCCCCC"> <table width="1100" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="2"><img src="image/header_edit_news2.jpg" width="1100" height="65"></td> </tr> <tr> <td colspan="2" bgcolor="#CC3366"> </td> </tr> <tr> <td width="230" rowspan="2" valign="top" bgcolor="#0000FF"><table width="230" border="0" cellspacing="4" cellpadding="0"> <tr> <td bgcolor="#FFFFFF"> </td> </tr> <tr> <td bgcolor="#66CCFF"> </td> </tr> <tr> <td bgcolor="#FFFFFF"> </td> </tr> <tr> <td bgcolor="#66CCFF"> </td> </tr> <tr> <td bgcolor="#FFFFFF"> </td> </tr> </table></td> <td width="870" valign="top" bgcolor="#FFFFFF"><form id="form_add_news" name="form_add_news" method="post" action="admin_newsB.php"> <table width="870" border="0" cellspacing="2" cellpadding="0"> <tr> <td colspan="2" bgcolor="#6699FF"><ul> <li class="style1">Add new announcement </li> </ul></td> </tr> <tr> <td width="82" height="31" bgcolor="#E0FCEA"><span class="style2">Date</span></td> <td width="782" bgcolor="#E0FCEA"><label> <input name="news_date" type="text" id="news_date" size="22" maxlength="20"> <a href="javascript:NewCal('news_date','ddmmmyyyy',true,12)"><img src="cal.gif" width="16" height="16" border="0"></a></label></td> </tr> <tr> <td height="31" bgcolor="#E0FCEA"><span class="style2">Title</span></td> <td bgcolor="#E0FCEA"><label> <input name="news_title" type="text" id="news_title" size="75" maxlength="150"> </label></td> </tr> <tr> <td height="138" valign="top" bgcolor="#E0FCEA"><span class="style2">Content</span></td> <td valign="top" bgcolor="#E0FCEA"><label> <textarea name="news_content" cols="60" rows="8" id="news_content"></textarea> </label></td> </tr> <tr> <td height="24" colspan="2" valign="top"><label> <div align="right"> <input type="reset" name="Reset" value="Reset"> <input name="add_news" type="submit" id="add_news" value="Save"> </div> </label></td> </tr> </table> </form> </td> </tr> <tr> <td height="447" valign="top" bgcolor="#FFFFFF"> <form action="admin_news2.php" method="post" name="form_news_list" id="form_news_list"> <table width="870" border="0" cellspacing="2" cellpadding="0"> <tr> <td colspan="3" bgcolor="#6699FF"><ul> <li class="style1">List of annoucement </li> </ul></td> </tr> <tr> <td width="155" bgcolor="#FFCCCC"><strong><span class="style3">Date</span></strong></td> <td width="625" bgcolor="#FFCCCC"><strong><span class="style3">Title</span></strong></td> <td width="82" bgcolor="#FFCCCC"><strong><span class="style3">Select</span></strong></td> </tr> <tr> <td bgcolor="#E0FCEA"> <?php $host="localhost"; // Host name $username="root"; // Mysql username $password=""; // Mysql password $db_name="nde_db"; // Database name mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("**** you.cannot select DB"); //LINK TO THE DATBASE----------------------------------------------------> ?> <? $result = mysql_query("SELECT * FROM news_list"); //$row = mysql_fetch_array( $result ); while($row = mysql_fetch_array( $result )) { $id = $row['id']; ?> <? echo $row['date'];?></td> <td bgcolor="#E0FCEA"><a href="#?id=<?=$id?> "><? echo $row['title']; ?></a></td> <td bgcolor="#E0FCEA"> </td> <? }?> </tr> <tr> <td colspan="3"> </td> </tr> </table> </form> </td> </tr> <tr> <td colspan="2" bgcolor="#CC3366"> </td> </tr> </table> </body> </html>
Last edited by digital-ether : Sep 7th, 2008 at 9:50 am. Reason: Please surround your code with [code] ... [/code] tags
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.
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!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)





Linear Mode