GH wrote:
With the following code, I am getting the following message....
Parse error: parse error, expecting `')'' in
/var/www/html/cert/admin_template.php on line 30


Line 30 Reads as follows:

foreach($admin_get_options_result as $api => $file, $desc)

Your syntax is incorrect on this statement. It should be:

foreach($admin_get_options_result as $api => $file)

PHP is expecting the ) after $file. Here's the documentation for foreach. http://www.php.net/manual/en/control-structures.foreach.php

Janet


Can any one please assist.

***************ENTIRE CODE STARTING AT LINE 1 FOLLOWS *************
<html>
<head>
<title>ADMINISTRATION SCREEN</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>

<?PHP require 'mod/db_access.php';

echo 'this is a test of the system';

if(!isset($_GET['api']) || (isset($_GET['api']) &&
((strlen(trim(urldecode($_GET['api']))) == 0) ||
(!is_int($_GET['api'])))))
$_GET['api']=0;

if($_GET['api'] == 0)
{
$admin_get_options_query_text = "Select * from Adminpage";
$admin_get_options_results_reference =
mysql_query($admin_get_options_query_text,$db_access) or die("Admin
Get Options: ". mysql_error());
$admin_get_options_result =
mysql_fetch_assoc($admin_get_options_result_reference);

if(mysql_num_rows($admin_get_options_results_reference)>0)
{
?>


                        <table width="600">
                        <TR> <TD> Link </TD> <TD> DESCRIPTION </TD></TR>
<?PHP
                        foreach($admin_get_options_result as $api => $file, $desc)
                        {
                                echo '<TR> <TD>';
                                echo '<a href="#?api'.urlencoded($api).'"> Click Here </a> 
</td>';
                                echo '<TD>'.$desc.'</TD></TR>';
                        }
?>

</table>

<?PHP }
}
else
{
$admin_get_page_query_text = "Select * from Adminpage Where
adminpageid = $_GET['api'] LIMIT 1";
$admin_get_page_results_reference =
mysql_query($admin_get_page_query_text,$db_access) or die("Admin Get
Page: ". mysql_error());
$admin_get_page_result = mysql_fetch_row($admin_get_page_result_reference);


if (mysql_num_rows($admin_get_page_results_reference) > 0)
{
require "mod/admin/".trim(strtolower($admin_get_page_result[1]));
}
else
{
echo "ERROR: Invalid Admin Page Requested <br>";
echo 'Please Try Again ... <a href="admin_template.php?api=0"> Click
Here </a>';
}
}
?>
</body>
</html>




--
Janet Valade -- janet.valade.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to