Php error |
Php error |
ishan |
Feb 15 2008, 12:59 PM
Post
#1
|
Novice Group: Members Posts: 26 Joined: 23-November 06 Member No.: 1,070 |
Hello friends...Following is the code which is written for the url http://techfun.info/aeDating-v4.1/admin/index.php
However when am opening it, it displays the error "Parse error: syntax error, unexpected $end in /home/techfuni/public_html/aeDating-v4.1/admin/index.php on line 260" Can anyone help me with this please?? Thnx!! CODE <? require_once( "../inc/header.inc.php" ); require_once( "{$dir['inc']}db.inc.php" ); require_once( "{$dir['inc']}admin.inc.php" ); require_once( "{$dir['inc']}profiles.inc.php" ); require_once( "{$dir['inc']}design.inc.php" ); require_once( "{$dir['inc']}admin_design.inc.php" ); require_once( "{$dir['inc']}utils.inc.php" ); if ( $_POST['ID'] ) { $admin_id = process_db_input( $_POST['ID'] ); $admin_pass = process_db_input( $_POST['Password'] ); $result = db_res( "SELECT * FROM `Admins` WHERE `Name` = '$admin_id' AND `Password` = '$admin_pass'" ); if ( mysql_num_rows( $result ) != 1 ) login_form( '<center><b><font color="#ff0000">Login Failed! Try again</font></b></center>', 1 ); } else { setcookie ("adminID", $_POST[ID], 0, "/");setcookie ("adminPassword", crypt( $_POST[Password], 'secret_string' ), 0, "/"); ?> Welcome back, <b><? echo $admin_id; ?></b>. Logging you in... <script language="Javascript">location.href='<? echo $_SERVER[PHP_SELF]; ?>';</script> <? exit; } } if ( !$_COOKIE['adminID'] || !$_COOKIE['adminPassword'] ) { // this is dynamic page - send headers to do not cache this page send_headers_page_changed(); login_form( "", 1 ); } $logged['admin'] = member_auth( 1 ); $free_mode = getParam("free_mode") == "on" ? 1 : 0; // Finance if ( !$free_mode ) { $tr_array = array(); $fin = sales_finance( $tr_array ); $full_amount = $fin['total']; } // total registered members $n_arr = db_arr( 'SELECT COUNT(*) FROM `Profiles`' ); // totel registered affiliates if ( $en_aff ) $aff_arr = db_arr( 'SELECT COUNT(*) FROM `aff`' ); // number of links $l_arr = db_arr( 'SELECT COUNT(*) FROM `Links`' ); // number of banners $b_arr = db_arr( 'SELECT COUNT(*) FROM `Banners` WHERE `Active` <> 0' ); // number of articles $a_arr = db_arr( 'SELECT COUNT(*) FROM Articles' ); // number of stories $s_arr = db_arr( 'SELECT COUNT(*) FROM `Stories`' ); // number of news $news_arr = db_arr( 'SELECT COUNT(*) FROM `News`' ); // number of mass letters $f_arr = db_arr( 'SELECT COUNT(*) FROM `NotifyMsgs`' ); // number od polls $polls_arr = db_arr( 'SELECT COUNT(*) FROM `polls_q`' ); // number od modules $mods_arr = db_arr( 'SELECT COUNT(*) FROM `Modules`' ); $status_arr[0] = "Unconfirmed"; $status_arr[1] = "Approval"; $status_arr[2] = "Active"; $status_arr[3] = "Rejected"; $status_arr[4] = "Suspended"; $_page['header'] = "Administrator Panel"; $_page['header_text'] = "Control Panel</b> (Server time: " . date( "H:i, d-M-Y" ) . ")"; // this is dynamic page - send headers to do not cache this page send_headers_page_changed(); TopCodeAdmin(); ?> <table width=100% border=0 cellpadding=0 class=text> <tr> <td width="100%" valign=top> <!-- Total registered members: Section Begin --> <table width=100% class=text cellpadding=0 cellspacing=0 border=0> <tr> <td width=10> <td width="610"> <div style="text-align: left; padding: 6px 6px 0 8px; background: url(images/head_block_green.gif) no-repeat 0px 6px; font: bold 10px Verdana; color:#FFFFFF; height:21px; line-height:16px">Total registered members:</div> <div style="text-align: left; border-left: 2px solid #2AA181; border-right: 2px solid #2AA181; width:598px; height:auto"> <div style="padding: 10px 10px 10px 10px"> <center> <table cellspacing=1 cellpadding=3 border=0 width="70%" align="center" bgcolor="#cccccc" > <tr> <td bgcolor=E5E5E5 class="text"><a href="<?php echo $site['url_admin']; ?>profiles.php">Total registered members:</a></td> <td bgcolor=E5E5E5 width=50 class="text" align="right"><b><?php echo $n_arr[0]; ?></b></td> </tr> <?php $i = 0; while( list( $key, $val ) = each( $status_arr ) ) { $n_arr = db_arr( "SELECT COUNT(*) FROM `Profiles` WHERE Status = '$val'" ); if ( $n_arr[0] ) { ?> <tr class="text"> <td class="text" bgcolor="#ffffff" align="left" valign="middle"> <img src=images/arrow.gif> <a href="profiles.php?profiles=<? echo $val; ?>"><? echo $val; ?></a> </td> <td class="prof_stat_<? echo $val; ?>" width="50" align="right"><? echo $n_arr[0]; ?></td> </tr> <? } } ?> </table> </center> </div> </div> <div><img src="images/foot_block_green.gif" height="6" width="602"></div> </td> </tr> </table> <!-- Total registered members: Section End --> <br> <!-- Site statistics Begin--> <div style="text-align: left; padding: 6px 6px 0 8px; background: url(images/head_block_green.gif) no-repeat 0px 6px; font: bold 10px Verdana; color:#FFFFFF; height:21px; line-height:16px">Site statistics</div> <div style="text-align: left; border-left: 2px solid #2AA181; border-right: 2px solid #2AA181; width:598px; height:auto"> <div style="padding: 10px 10px 10px 10px"> <center> <table bgcolor=CCCCCC width=70% cellspacing=0 cellpadding=1 align="center" border="0"> <tr> <td> <table width=100% class=text cellpadding=3 cellspacing=1> <tr> <td bgcolor=FFFFFF align="left"> <img src=images/arrow.gif> <a href="<?php echo $site['url_admin']; ?>links.php"><font color=0000FF>Links</font></a> </td> <td bgcolor=FFFFFF width=50 align="right"><?php echo $l_arr[0]; ?></td> </tr> <tr> <td bgcolor=FFFFFF align="left"> <img src=images/arrow.gif><a href="<?php echo $site['url_admin']; ?>banners.php"><font color=0000FF>Banners</font></a></td> <td bgcolor=FFFFFF width=50 align="right"><?php echo $b_arr[0]; ?></td> </tr> <tr> <td bgcolor=FFFFFF align="left"> <img src=images/arrow.gif><a href="<?php echo $site['url_admin']; ?>news.php"><font color=0000FF>News</font></a></td> <td bgcolor=FFFFFF align="right"><?php echo $news_arr[0]; ?></td> </tr> <tr> <td bgcolor=FFFFFF align="left"> <img src=images/arrow.gif><a href="<?php echo $site['url_admin']; ?>articles.php"><font color=0000FF>Articles</font></a></td> <td bgcolor=FFFFFF align="right"><?php echo $a_arr[0]; ?></td> </tr> <tr> <td bgcolor=FFFFFF align="left"> <img src=images/arrow.gif><a href="<?php echo $site['url']; ?>story.php"><font color=0000FF>Feedback</font></a></td> <td bgcolor=FFFFFF align="right"><?php echo $s_arr[0]; ?></td> </tr> <tr> <td bgcolor=FFFFFF align="left"> <img src=images/arrow.gif><a href="<?php echo $site['url_admin']; ?>polls.php"><font color=0000FF>Polls</font></a></td> <td bgcolor=FFFFFF align="right"><?php echo $polls_arr[0]; ?></td> </tr> <tr> <td bgcolor=FFFFFF align="left"> <img src=images/arrow.gif><a href="<?php echo $site['url_admin']; ?>notifies.php"><font color=0000FF>Mass letters</font></a></td> <td bgcolor=FFFFFF align="right"><?php echo $f_arr[0]; ?></td> </tr> <tr> <td bgcolor=FFFFFF align="left"> <img src=images/arrow.gif><a href="<?php echo $site['url_admin']; ?>modules.php"><font color=0000FF>Modules</font></a></td> <td bgcolor=FFFFFF align="right"><?php echo $mods_arr[0]; ?></td> </tr> </table> </td></tr></table> </center> </div> </div> <div><img src="images/foot_block_green.gif" height="6" width="602"></div> <!-- Site statistics End--> <br> <div style="text-align: left; padding: 6px 6px 0 8px; background: url(images/head_block_green.gif) no-repeat 0px 6px; font: bold 10px Verdana; color:#FFFFFF; height:21px; line-height:16px">Site network</div> <div style="text-align: left; border-left: 2px solid #2AA181; border-right: 2px solid #2AA181; width:598px; height:auto"> <div style="padding: 10px 10px 10px 10px"> <center><table bgcolor=CCCCCC width=70% cellspacing=0 cellpadding=1 align="center" width="100%"><tr><td> <table width=100% class=text cellpadding=3 cellspacing=1> <tr> <td bgcolor=FFFFFF align="left"> <img src=images/arrow.gif><a href="<?php echo $site['url_aff']; ?>partners.php"><font color=0000FF>Affiliates</font></a></td> <td bgcolor=FFFFFF width="50" align="right"><?php echo $aff_arr[0]; ?></td> </tr> </table> </td></tr></table></center> </div> </div> <div><img src="images/foot_block_green.gif" height="6" width="602"></div> <br> <div style="text-align: left; padding: 6px 6px 0 8px; background: url(images/head_block_green.gif) no-repeat 0px 6px; font: bold 10px Verdana; color:#FFFFFF; height:21px; line-height:16px">Admin quick links:</div> <div style="text-align: left; border-left: 2px solid #2AA181; border-right: 2px solid #2AA181; width:598px; height:auto"> <div style="padding: 10px 10px 10px 10px"> <table class=text cellpadding=3 cellspacing=1 width="100%" border="0"><tr> <td width=50% valign=top align="left"> <br> - <a href="<?php echo $site['url_admin']; ?>contact_discounts.php">Make all services free for all members</a><br> - <a href="<?php echo $site['url_admin']; ?>global_settings.php?cat=ap">Change administrator's login and password</a><br> - <a href="<?php echo $site['url_aff']; ?>partners.php">Manage affiliates</a><br> - <a href="<?php echo $site['url_admin']; ?>links.php">Add new link to links page</a><br> - <a href="<?php echo $site['url']; ?>story.php">Review and activate feedback submission</a><br> - <a href="<?php echo $site['url_admin']; ?>finance.php">Calculate my earnings for this month</a><br> <br><br> </td> <tr> <td colspan="2" align="center" height="1"> <hr size="1" width="90%" style="color:silver"> </td> </tr> <tr> <td colspan="2" align="center" > Your current version is <?php echo $site['ver']. " patch " .$site['build']; ?> <br><br><b><u>Updates:</u></b> <br> <?php echo stripslashes($_COOKIE['new_version']); ?> <br><br> </td> </tr></table> </div> </div> <div><img src="images/foot_block_green.gif" height="6" width="602"></div> </td> </tr> </table> <? BottomCodeAdmin(); ?> |
Brian Chandler |
Feb 15 2008, 01:19 PM
Post
#2
|
Jocular coder Group: Members Posts: 2,460 Joined: 31-August 06 Member No.: 43 |
QUOTE However when am opening it, it displays the error "Parse error: syntax error, unexpected $end in /home/techfuni/public_html/aeDating-v4.1/admin/index.php on line 260" Since the file is around 260 lines long, this almost certainly means it got to the end of file when not expecting it - i.e. there is a bracket of some sort, { or ( that is not matched. You need to use a syntax hghlighting editor to check it. |
ishan |
Feb 16 2008, 09:27 AM
Post
#3
|
Novice Group: Members Posts: 26 Joined: 23-November 06 Member No.: 1,070 |
Hii Friends,
Thnx a lot for the reply.Tried to use 2-3 editors and syntax checkers but in vain.Can anyone please tell me which brackets are causing the harm? Any help wud be appreciated...thnx a lot again!! |
Brian Chandler |
Feb 17 2008, 12:53 AM
Post
#4
|
Jocular coder Group: Members Posts: 2,460 Joined: 31-August 06 Member No.: 43 |
Sorry, but this is called "debugging your program". Unless you're paying, you can't really expect someone else to do it for you.
The other basic technique is to remove chunks of the program one by one, until you get something that compiles ok, then add them back one by one, so you can identify where the problem is. |
Lo-Fi Version | Time is now: 28th March 2024 - 04:34 AM |