salento9 Posted May 16, 2011 Share Posted May 16, 2011 Can you help me with this piece of code? i receive the following error message: syntax error, unexpected '<' <?php function left($value,$NbChar) { return substr($value,0,$NbChar); } function right($value,$NbChar) { return substr($value,strlen($value)-$NbChar,$NbChar); } function mid($value,$Depart,$NbChar) { return substr($value,$Depart-1,$NbChar); } function RaiseError($Message) { ?> <?php <DIV STYLE='font-family: Tahoma; font-size: 11px; color: #000000'><BR> <IMG SRC='error.gif' WIDTH=9 HEIGHT=9> <?php echo $Message; ?></DIV> </BODY> </HTML> } ?> Quote Link to comment https://forums.phpfreaks.com/topic/236516-syntax-error-unexpected/ Share on other sites More sharing options...
kney Posted May 16, 2011 Share Posted May 16, 2011 This should work <?php function left($value,$NbChar) { return substr($value,0,$NbChar); } function right($value,$NbChar) { return substr($value,strlen($value)-$NbChar,$NbChar); } function mid($value,$Depart,$NbChar) { return substr($value,$Depart-1,$NbChar); } function RaiseError($Message) { echo "<DIV STYLE='font-family: Tahoma; font-size: 11px; color: #000000'><BR> <IMG SRC='error.gif' WIDTH=9 HEIGHT=9> " . $Message . "</DIV>"; echo "</BODY>"; echo "</HTML>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/236516-syntax-error-unexpected/#findComment-1215919 Share on other sites More sharing options...
salento9 Posted May 16, 2011 Author Share Posted May 16, 2011 Thanks for your answer but now i receive : Parse error: syntax error, unexpected $end on line 325 full code: <?php /* Copyright (C) Jean-Damien POGOLOTTI This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. [browser.php] Draw User window interface, retrieve OUs. require phpAD.config.php */ include("phpAD.config.php"); set_time_limit(0); $Field = $_GET["Field"]; $Values = $_GET["Values"]; $Format = $_GET["Format"]; $Column = $_GET["Column"]; $CurrentValue = $_GET["CurrentValue"]; if ( $Column == "" ) { $Column = "description"; } ?> <HTML> <HEAD> <STYLE> a.liens:link {color: #FFFFFF; text-decoration: none} a.liens:visited {color: #FFFFFF; text-decoration: none} a.liens:hover {color: #243C46; text-decoration: underline} a.liens2:link {color: #5B5B3F; text-decoration: none} a.liens2:visited {color: #5B5B3F; text-decoration: none} a.liens2:hover {color: #3B3B1F; text-decoration: underline} </STYLE> <TITLE><?php echo $phpAD["ldap_window_title"]; ?></TITLE> </HEAD> <BODY BGCOLOR=#D4D0C8 bottomMargin=0 leftMargin=0 rightMargin=0 text=#000000 topMargin=0 vLink=#80b0e0 marginwidth="0" marginheight="0"> <?php // Set the base dn to search the entire directory. $base_dn = $phpAD["ldap_dn"]; // connect to server if (!($connect=@ldap_connect($phpAD["ldap_server"]))) { RaiseError("Could not connect to the LDAP server, review your server configuration."); exit(); } // bind to server if (!($bind=@ldap_bind($connect, $phpAD["auth_user"], $phpAD["auth_pass"]))) { RaiseError("Unable to bind to the server, review your credential configuration."); exit(); } $filter = "(&(objectClass=organizationalUnit))"; $justthese = array("name"); // search active directory if (!($search=@ldap_search($connect, $base_dn, $filter,$justthese,1))) { RaiseError("Unable to search the Active Directory, review your LDAP path configuration."); exit(); } $number_returned = ldap_count_entries($connect,$search); $info = ldap_get_entries($connect, $search); $CurrentOU = $phpAD["ldap_default_ou"]; $NbRecords = $info["count"]; for ($i=1;$i<$NbRecords;$i++) { $OU=$info[$i]["dn"]; $OU=left($OU,strpos($OU,",")); $OU=right($OU,strlen($OU)-3); if (isset($OUs)) { if ( $OU != "" && !$OUs[$OU] ) $OUs[]=$OU; } else { $OUs[]=$OU; } ?> <FORM NAME="DaForm" METHOD="post"> <TABLE WIDTH=100% HEIGHT=15 NOBORDER CELLPADDING=0 CELLSPACING=0><TR><TD></TD></TR></TABLE> <CENTER> <TABLE NOBORDER CELLPADDING=0 CELLSPACING=0><TR> <TD><FONT FACE='Verdana' STYLE='Font-Size: 11px;' COLOR=#000000><U>S</U>elect the <B>OU</B> you want to search in:</FONT></TD> <TD WIDTH=20></TD> <TD WIDTH=285> <SELECT NAME="OU" STYLE='Font-Family: Tahoma; Font-Size: 11px;' onchange="ChangeOU(this.form)"> <OPTION VALUE="-1">----------------------------------------------------------------- <?php $NbRecords = $info[count]; $Found = FALSE; for ($i=0;$i<=count($OUs)-1;$i++) { if ( $OUs[$i] == $CurrentOU ) { $Found = TRUE; ?> <OPTION SELECTED VALUE="<?php echo $OUs[$i]; ?>"><?php echo $OUs[$i]; ?><?php } else { ?> <OPTION VALUE="<?php echo $OUs[$i]; ?>"><?php echo $OUs[$i]; ?><?php } } if ( $Found == FALSE ) $CurrentOU = ""; ?> </SELECT> </TD> </TR></TABLE> </CENTER> <TABLE WIDTH=100% HEIGHT=10 NOBORDER CELLPADDING=0 CELLSPACING=0><TR><TD></TD></TR></TABLE> <CENTER> <TABLE NOBORDER CELLPADDING=0 CELLSPACING=0> <TR> <TD BGCOLOR=#808080 WIDTH=1></TD> <TD BGCOLOR=#808080 WIDTH=514></TD> <TD BGCOLOR=#808080 WIDTH=1></TD> </TR><TR> <TD BGCOLOR=#808080></TD> <TD HEIGHT=200> <TABLE NOBORDER CELLPADDING=0 CELLSPACING=0> <TR> <TD BGCOLOR=#404040 WIDTH=1></TD> <TD BGCOLOR=#404040 WIDTH=512></TD> <TD BGCOLOR=#404040 WIDTH=1></TD> </TR><TR> <TD BGCOLOR=#404040></TD> <TD HEIGHT=198> <TABLE NOBORDER CELLPADDING=0 CELLSPACING=0><TR> <TD> <TABLE NOBORDER CELLPADDING=0 CELLSPACING=0> <TR> <TD BGCOLOR=#FFFFFF WIDTH=1></TD> <TD BGCOLOR=#FFFFFF WIDTH=100></TD> <TD BGCOLOR=#FFFFFF WIDTH=1></TD> </TR><TR> <TD BGCOLOR=#FFFFFF></TD> <TD WIDTH=250 BGCOLOR=#D4D0C8><FONT STYLE='Font-Family: Tahoma; Font-Size: 11px;'> Name</FONT></TD> <TD BGCOLOR=#808080></TD> </TR><TR> <TD BGCOLOR=#808080></TD> <TD BGCOLOR=#808080></TD> <TD BGCOLOR=#808080></TD> </TR> </TABLE> </TD> <TD WIDTH=1 BGCOLOR=#404040></TD> <TD> <TABLE NOBORDER CELLPADDING=0 CELLSPACING=0> <TR> <TD BGCOLOR=#FFFFFF WIDTH=1></TD> <TD BGCOLOR=#FFFFFF WIDTH=100></TD> <TD BGCOLOR=#FFFFFF WIDTH=1></TD> </TR><TR> <TD BGCOLOR=#FFFFFF></TD> <TD WIDTH=240 BGCOLOR=#D4D0C8><FONT STYLE='Font-Family: Tahoma; Font-Size: 11px;'> <?php echo $Column; ?></FONT></TD> <TD BGCOLOR=#808080></TD> </TR><TR> <TD BGCOLOR=#808080></TD> <TD BGCOLOR=#808080></TD> <TD BGCOLOR=#808080></TD> </TR> </TABLE> </TD> <TD WIDTH=1 BGCOLOR=#404040></TD> <TD> <TABLE NOBORDER CELLPADDING=0 CELLSPACING=0> <TR> <TD BGCOLOR=#FFFFFF WIDTH=1></TD> <TD BGCOLOR=#FFFFFF></TD> <TD BGCOLOR=#FFFFFF WIDTH=1></TD> </TR><TR> <TD BGCOLOR=#FFFFFF></TD> <TD WIDTH=13 HEIGHT=13 BGCOLOR=#D4D0C8><CENTER><IMG SRC='cross2.gif' WIDTH=6 HEIGHT=8></CENTER></TD> <TD BGCOLOR=#808080></TD> </TR><TR> <TD BGCOLOR=#808080></TD> <TD BGCOLOR=#808080></TD> <TD BGCOLOR=#808080></TD> </TR> </TABLE> </TD> <TD WIDTH=1 BGCOLOR=#404040></TD> </TR></TABLE> <TABLE BGCOLOR=#404040 WIDTH=100% HEIGHT=1 NOBORDER CELLPADDING=0 CELLSPACING=0><TR><TD></TD></TR></TABLE> <IFRAME NAME='InSet' SRC='Load.php?OU=<?php echo $CurrentOU; ?>&Values=<?php echo $Values; ?>&Format=<?php echo $Format; ?>&Column=<?php echo $Column; ?>' WIDTH=100% HEIGHT=185 FRAMEBORDER=0></IFRAME> </TD> <TD BGCOLOR=#D4D0C8></TD> </TR><TR> <TD BGCOLOR=#D4D0C8></TD> <TD BGCOLOR=#D4D0C8></TD> <TD BGCOLOR=#D4D0C8></TD> </TR> </TABLE> </TD> <TD BGCOLOR=#FFFFFF></TD> </TR><TR> <TD BGCOLOR=#FFFFFF></TD> <TD BGCOLOR=#FFFFFF></TD> <TD BGCOLOR=#FFFFFF></TD> </TR> </TABLE> </CENTER> <TABLE WIDTH=100% HEIGHT=10 NOBORDER CELLPADDING=0 CELLSPACING=0><TR><TD></TD></TR></TABLE> <CENTER> <?php if ( $CurrentValue."" == "" ) $TextContent = $phpAD["ldap_def_string"]; else $TextContent = str_replace("¤",";",$CurrentValue); $UserAgent=getenv("HTTP_USER_AGENT"); if ( eregi("MSIE",$UserAgent) ) { ?> <TEXTAREA NAME='Users' ID='Users' COLS=99 ROWS=4 STYLE='font-family: Tahoma; font-size: 11px;'><?php echo $TextContent; ?></TEXTAREA> <?php } else { ?> <TEXTAREA NAME='Users' ID='Users' COLS=96 ROWS=4 STYLE='font-family: Tahoma; font-size: 11px;'><?php echo $TextContent; ?></TEXTAREA> <?php } ?> </CENTER> <TABLE WIDTH=100% HEIGHT=10 NOBORDER CELLPADDING=0 CELLSPACING=0><TR><TD></TD></TR></TABLE> <TABLE WIDTH=100% NOBORDER CELLPADDING=0 CELLSPACING=0><TR VALIGN=Middle> <TD WIDTH=60%> <TABLE NOBORDER CELLPADDING=0 CELLSPACING=0><TR> <TD WIDTH=12></TD> <TD><FONT FACE='Verdana' STYLE='Font-Size: 11px;' COLOR=#000000><U>S</U>earch for :</FONT></TD> <TD WIDTH=10></TD> <TD><INPUT TYPE=text NAME="SearchFor" SIZE=30 STYLE='Font-Family: Tahoma; Font-Size: 11px;'></TD> <TD WIDTH=10></TD> <TD><A HREF='javascript:Search();'><IMG SRC='search.gif' WIDTH=16 HEIGHT=16 BORDER=0></A></TD> </TR></TABLE> </TD> <TD WIDTH=40%> <DIV ALIGN=Right> <TABLE NOBORDER CELLPADDING=0 CELLSPACING=0><TR> <TD STYLE='border: 1px solid #000000'><INPUT TYPE="Button" OnClick="Validate();" VALUE=" OK " STYLE="BACKGROUND-COLOR: #D4D0C8; BORDER-BOTTOM: #808080 1px solid; BORDER-LEFT: #FFFFFF 1px solid; BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #FFFFFF 1px solid; COLOR: #000000; FONT-FAMILY: Tahoma; FONT-SIZE: 10pt;"></TD> <TD WIDTH=15></TD> <TD STYLE='border: 1px solid #606060'><INPUT TYPE="Button" OnClick="window.close();" VALUE=" Cancel " STYLE="BACKGROUND-COLOR: #D4D0C8; BORDER-BOTTOM: #808080 1px solid; BORDER-LEFT: #FFFFFF 1px solid; BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #FFFFFF 1px solid; COLOR: #000000; FONT-FAMILY: Tahoma; FONT-SIZE: 10pt"></TD> <TD WIDTH=12></TD> </TR></TABLE> </DIV> </TD> </TR></TABLE> </FORM> </BODY> </HTML> <SCRIPT> document.getElementById("Users").focus(); function Search() { Filter = DaForm.SearchFor.value; DaOU = DaForm.OU.options[DaForm.OU.selectedIndex].value; DaURL = "Load.php?OU="+DaOU+"&Values=<?php echo $Values; ?>&Format=<?php echo $Format; ?>&Filter="+Filter+"&Column=<?php echo $Column; ?>"; InSet.document.location = DaURL; } function Validate() { <?php if ( $Field."" != "" ) { ?> Values = document.getElementById("Users").value; if ( Values != "<?php echo $phpAD["ldap_def_string"]; ?>" ) opener.document.getElementById("<?php echo $Field; ?>").value = Values; <?php } ?> window.close(); } function ChangeOU(Value) { if (Value.OU.selectedIndex != 0) { DaOU = Value.OU.options[Value.OU.selectedIndex].value; DaURL = "Load.php?OU="+DaOU+"&Values=<?php echo $Values; ?>&Format=<?php echo $Format; ?>&Column=<?php echo $Column; ?>"; InSet.document.location = DaURL; } } </SCRIPT> <?php function left($value,$NbChar) { return substr($value,0,$NbChar); } function right($value,$NbChar) { return substr($value,strlen($value)-$NbChar,$NbChar); } function mid($value,$Depart,$NbChar) { return substr($value,$Depart-1,$NbChar); } function RaiseError($Message) { echo "<DIV STYLE='font-family: Tahoma; font-size: 11px; color: #000000'><BR> <IMG SRC='error.gif' WIDTH=9 HEIGHT=9> " . $Message . "</DIV>"; echo "</BODY>"; echo "</HTML>"; } ?> ?> Quote Link to comment https://forums.phpfreaks.com/topic/236516-syntax-error-unexpected/#findComment-1215927 Share on other sites More sharing options...
kney Posted May 16, 2011 Share Posted May 16, 2011 you put 2 closing tags at the end of ur script.. "?>" Quote Link to comment https://forums.phpfreaks.com/topic/236516-syntax-error-unexpected/#findComment-1215929 Share on other sites More sharing options...
salento9 Posted May 16, 2011 Author Share Posted May 16, 2011 Thanks again for your quick answer, it's very nice to see that, >you put 2 closing tags at the end of ur script.. "?>" Yes it's true but it was a test for me, but i have same error message with just one closing tag. Quote Link to comment https://forums.phpfreaks.com/topic/236516-syntax-error-unexpected/#findComment-1215932 Share on other sites More sharing options...
kney Posted May 16, 2011 Share Posted May 16, 2011 The error is most likely cause by a misplaced bracket "}".. I did see u didn't use brackets in some parts of ur code.. if ( $Found == FALSE ) $CurrentOU = ""; Quote Link to comment https://forums.phpfreaks.com/topic/236516-syntax-error-unexpected/#findComment-1215933 Share on other sites More sharing options...
salento9 Posted May 16, 2011 Author Share Posted May 16, 2011 Thanks i found where i had to add the bracket. Can you help me again in this part of code? i have "undefined variable" on the 3 line of code <?php $NbRecords = $info["count"]; $Found = FALSE; for ($i=0;$i<=count($OUs)-1;$i++) { if ( $OUs[$i] == $CurrentOU ) { $Found = TRUE; ?> <OPTION SELECTED VALUE="<?php echo $OUs[$i]; ?>"><?php echo $OUs[$i]; ?><?php } else { ?> <OPTION VALUE="<?php echo $OUs[$i]; ?>"><?php echo $OUs[$i]; ?><?php } } if ( $Found == FALSE ) $CurrentOU = ""; ?> Quote Link to comment https://forums.phpfreaks.com/topic/236516-syntax-error-unexpected/#findComment-1215937 Share on other sites More sharing options...
kney Posted May 16, 2011 Share Posted May 16, 2011 Is that the whole page?.. Or is there more Quote Link to comment https://forums.phpfreaks.com/topic/236516-syntax-error-unexpected/#findComment-1215938 Share on other sites More sharing options...
salento9 Posted May 16, 2011 Author Share Posted May 16, 2011 the entire code, error code is on line 116 <?php /* Copyright (C) Jean-Damien POGOLOTTI This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. [browser.php] Draw User window interface, retrieve OUs. require phpAD.config.php */ include("phpAD.config.php"); set_time_limit(0); $Field = $_GET["Field"]; $Values = $_GET["Values"]; $Format = $_GET["Format"]; $Column = $_GET["Column"]; $CurrentValue = $_GET["CurrentValue"]; if ( $Column == "" ) { $Column = "description"; } ?> <HTML> <HEAD> <STYLE> a.liens:link {color: #FFFFFF; text-decoration: none} a.liens:visited {color: #FFFFFF; text-decoration: none} a.liens:hover {color: #243C46; text-decoration: underline} a.liens2:link {color: #5B5B3F; text-decoration: none} a.liens2:visited {color: #5B5B3F; text-decoration: none} a.liens2:hover {color: #3B3B1F; text-decoration: underline} </STYLE> <TITLE><?php echo $phpAD["ldap_window_title"]; ?></TITLE> </HEAD> <BODY BGCOLOR=#D4D0C8 bottomMargin=0 leftMargin=0 rightMargin=0 text=#000000 topMargin=0 vLink=#80b0e0 marginwidth="0" marginheight="0"> <?php // Set the base dn to search the entire directory. $base_dn = $phpAD["ldap_dn"]; // connect to server if (!($connect=@ldap_connect($phpAD["ldap_server"]))) { RaiseError("Could not connect to the LDAP server, review your server configuration."); exit(); } // bind to server if (!($bind=@ldap_bind($connect, $phpAD["auth_user"], $phpAD["auth_pass"]))) { RaiseError("Unable to bind to the server, review your credential configuration."); exit(); } $filter = "(&(objectClass=organizationalUnit))"; $justthese = array("name"); // search active directory if (!($search=@ldap_search($connect, $base_dn, $filter,$justthese,1))) { RaiseError("Unable to search the Active Directory, review your LDAP path configuration."); exit(); } $number_returned = ldap_count_entries($connect,$search); $info = ldap_get_entries($connect, $search); $CurrentOU = $phpAD["ldap_default_ou"]; $NbRecords = $info["count"]; for ($i=1;$i<$NbRecords;$i++) { $OU=$info[$i]["dn"]; $OU=left($OU,strpos($OU,",")); $OU=right($OU,strlen($OU)-3); if (isset($OUs)) { if ( $OU != "" && !$OUs[$OU] ) $OUs[]=$OU; } else { $OUs[]=$OU; } } ?> <FORM NAME="DaForm" METHOD="post"> <TABLE WIDTH=100% HEIGHT=15 NOBORDER CELLPADDING=0 CELLSPACING=0><TR><TD></TD></TR></TABLE> <CENTER> <TABLE NOBORDER CELLPADDING=0 CELLSPACING=0><TR> <TD><FONT FACE='Verdana' STYLE='Font-Size: 11px;' COLOR=#000000><U>S</U>elect the <B>OU</B> you want to search in:</FONT></TD> <TD WIDTH=20></TD> <TD WIDTH=285> <SELECT NAME="OU" STYLE='Font-Family: Tahoma; Font-Size: 11px;' onchange="ChangeOU(this.form)"> <OPTION VALUE="-1">----------------------------------------------------------------- <?php $NbRecords = $info["count"]; $Found = FALSE; for ($i=0;$i<=count($OUs)-1;$i++) { if ( $OUs[$i] == $CurrentOU ) { $Found = TRUE; ?> <OPTION SELECTED VALUE="<?php echo $OUs[$i]; ?>"><?php echo $OUs[$i]; ?><?php } else { ?> <OPTION VALUE="<?php echo $OUs[$i]; ?>"><?php echo $OUs[$i]; ?><?php } } if ( $Found == FALSE ) $CurrentOU = ""; ?> </SELECT> </TD> </TR></TABLE> </CENTER> <TABLE WIDTH=100% HEIGHT=10 NOBORDER CELLPADDING=0 CELLSPACING=0><TR><TD></TD></TR></TABLE> <CENTER> <TABLE NOBORDER CELLPADDING=0 CELLSPACING=0> <TR> <TD BGCOLOR=#808080 WIDTH=1></TD> <TD BGCOLOR=#808080 WIDTH=514></TD> <TD BGCOLOR=#808080 WIDTH=1></TD> </TR><TR> <TD BGCOLOR=#808080></TD> <TD HEIGHT=200> <TABLE NOBORDER CELLPADDING=0 CELLSPACING=0> <TR> <TD BGCOLOR=#404040 WIDTH=1></TD> <TD BGCOLOR=#404040 WIDTH=512></TD> <TD BGCOLOR=#404040 WIDTH=1></TD> </TR><TR> <TD BGCOLOR=#404040></TD> <TD HEIGHT=198> <TABLE NOBORDER CELLPADDING=0 CELLSPACING=0><TR> <TD> <TABLE NOBORDER CELLPADDING=0 CELLSPACING=0> <TR> <TD BGCOLOR=#FFFFFF WIDTH=1></TD> <TD BGCOLOR=#FFFFFF WIDTH=100></TD> <TD BGCOLOR=#FFFFFF WIDTH=1></TD> </TR><TR> <TD BGCOLOR=#FFFFFF></TD> <TD WIDTH=250 BGCOLOR=#D4D0C8><FONT STYLE='Font-Family: Tahoma; Font-Size: 11px;'> Name</FONT></TD> <TD BGCOLOR=#808080></TD> </TR><TR> <TD BGCOLOR=#808080></TD> <TD BGCOLOR=#808080></TD> <TD BGCOLOR=#808080></TD> </TR> </TABLE> </TD> <TD WIDTH=1 BGCOLOR=#404040></TD> <TD> <TABLE NOBORDER CELLPADDING=0 CELLSPACING=0> <TR> <TD BGCOLOR=#FFFFFF WIDTH=1></TD> <TD BGCOLOR=#FFFFFF WIDTH=100></TD> <TD BGCOLOR=#FFFFFF WIDTH=1></TD> </TR><TR> <TD BGCOLOR=#FFFFFF></TD> <TD WIDTH=240 BGCOLOR=#D4D0C8><FONT STYLE='Font-Family: Tahoma; Font-Size: 11px;'> <?php echo $Column; ?></FONT></TD> <TD BGCOLOR=#808080></TD> </TR><TR> <TD BGCOLOR=#808080></TD> <TD BGCOLOR=#808080></TD> <TD BGCOLOR=#808080></TD> </TR> </TABLE> </TD> <TD WIDTH=1 BGCOLOR=#404040></TD> <TD> <TABLE NOBORDER CELLPADDING=0 CELLSPACING=0> <TR> <TD BGCOLOR=#FFFFFF WIDTH=1></TD> <TD BGCOLOR=#FFFFFF></TD> <TD BGCOLOR=#FFFFFF WIDTH=1></TD> </TR><TR> <TD BGCOLOR=#FFFFFF></TD> <TD WIDTH=13 HEIGHT=13 BGCOLOR=#D4D0C8><CENTER><IMG SRC='cross2.gif' WIDTH=6 HEIGHT=8></CENTER></TD> <TD BGCOLOR=#808080></TD> </TR><TR> <TD BGCOLOR=#808080></TD> <TD BGCOLOR=#808080></TD> <TD BGCOLOR=#808080></TD> </TR> </TABLE> </TD> <TD WIDTH=1 BGCOLOR=#404040></TD> </TR></TABLE> <TABLE BGCOLOR=#404040 WIDTH=100% HEIGHT=1 NOBORDER CELLPADDING=0 CELLSPACING=0><TR><TD></TD></TR></TABLE> <IFRAME NAME='InSet' SRC='Load.php?OU=<?php echo $CurrentOU; ?>&Values=<?php echo $Values; ?>&Format=<?php echo $Format; ?>&Column=<?php echo $Column; ?>' WIDTH=100% HEIGHT=185 FRAMEBORDER=0></IFRAME> </TD> <TD BGCOLOR=#D4D0C8></TD> </TR><TR> <TD BGCOLOR=#D4D0C8></TD> <TD BGCOLOR=#D4D0C8></TD> <TD BGCOLOR=#D4D0C8></TD> </TR> </TABLE> </TD> <TD BGCOLOR=#FFFFFF></TD> </TR><TR> <TD BGCOLOR=#FFFFFF></TD> <TD BGCOLOR=#FFFFFF></TD> <TD BGCOLOR=#FFFFFF></TD> </TR> </TABLE> </CENTER> <TABLE WIDTH=100% HEIGHT=10 NOBORDER CELLPADDING=0 CELLSPACING=0><TR><TD></TD></TR></TABLE> <CENTER> <?php if ( $CurrentValue."" == "" ) $TextContent = $phpAD["ldap_def_string"]; else $TextContent = str_replace("¤",";",$CurrentValue); $UserAgent=getenv("HTTP_USER_AGENT"); if ( eregi("MSIE",$UserAgent) ) { ?> <TEXTAREA NAME='Users' ID='Users' COLS=99 ROWS=4 STYLE='font-family: Tahoma; font-size: 11px;'><?php echo $TextContent; ?></TEXTAREA> <?php } else { ?> <TEXTAREA NAME='Users' ID='Users' COLS=96 ROWS=4 STYLE='font-family: Tahoma; font-size: 11px;'><?php echo $TextContent; ?></TEXTAREA> <?php } ?> </CENTER> <TABLE WIDTH=100% HEIGHT=10 NOBORDER CELLPADDING=0 CELLSPACING=0><TR><TD></TD></TR></TABLE> <TABLE WIDTH=100% NOBORDER CELLPADDING=0 CELLSPACING=0><TR VALIGN=Middle> <TD WIDTH=60%> <TABLE NOBORDER CELLPADDING=0 CELLSPACING=0><TR> <TD WIDTH=12></TD> <TD><FONT FACE='Verdana' STYLE='Font-Size: 11px;' COLOR=#000000><U>S</U>earch for :</FONT></TD> <TD WIDTH=10></TD> <TD><INPUT TYPE=text NAME="SearchFor" SIZE=30 STYLE='Font-Family: Tahoma; Font-Size: 11px;'></TD> <TD WIDTH=10></TD> <TD><A HREF='javascript:Search();'><IMG SRC='search.gif' WIDTH=16 HEIGHT=16 BORDER=0></A></TD> </TR></TABLE> </TD> <TD WIDTH=40%> <DIV ALIGN=Right> <TABLE NOBORDER CELLPADDING=0 CELLSPACING=0><TR> <TD STYLE='border: 1px solid #000000'><INPUT TYPE="Button" OnClick="Validate();" VALUE=" OK " STYLE="BACKGROUND-COLOR: #D4D0C8; BORDER-BOTTOM: #808080 1px solid; BORDER-LEFT: #FFFFFF 1px solid; BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #FFFFFF 1px solid; COLOR: #000000; FONT-FAMILY: Tahoma; FONT-SIZE: 10pt;"></TD> <TD WIDTH=15></TD> <TD STYLE='border: 1px solid #606060'><INPUT TYPE="Button" OnClick="window.close();" VALUE=" Cancel " STYLE="BACKGROUND-COLOR: #D4D0C8; BORDER-BOTTOM: #808080 1px solid; BORDER-LEFT: #FFFFFF 1px solid; BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #FFFFFF 1px solid; COLOR: #000000; FONT-FAMILY: Tahoma; FONT-SIZE: 10pt"></TD> <TD WIDTH=12></TD> </TR></TABLE> </DIV> </TD> </TR></TABLE> </FORM> </BODY> </HTML> <SCRIPT> document.getElementById("Users").focus(); function Search() { Filter = DaForm.SearchFor.value; DaOU = DaForm.OU.options[DaForm.OU.selectedIndex].value; DaURL = "Load.php?OU="+DaOU+"&Values=<?php echo $Values; ?>&Format=<?php echo $Format; ?>&Filter="+Filter+"&Column=<?php echo $Column; ?>"; InSet.document.location = DaURL; } function Validate() { <?php if ( $Field."" != "" ) { ?> Values = document.getElementById("Users").value; if ( Values != "<?php echo $phpAD["ldap_def_string"]; ?>" ) opener.document.getElementById("<?php echo $Field; ?>").value = Values; <?php } ?> window.close(); } function ChangeOU(Value) { if (Value.OU.selectedIndex != 0) { DaOU = Value.OU.options[Value.OU.selectedIndex].value; DaURL = "Load.php?OU="+DaOU+"&Values=<?php echo $Values; ?>&Format=<?php echo $Format; ?>&Column=<?php echo $Column; ?>"; InSet.document.location = DaURL; } } </SCRIPT> <?php function left($value,$NbChar) { return substr($value,0,$NbChar); } function right($value,$NbChar) { return substr($value,strlen($value)-$NbChar,$NbChar); } function mid($value,$Depart,$NbChar) { return substr($value,$Depart-1,$NbChar); } function RaiseError($Message) { echo "<DIV STYLE='font-family: Tahoma; font-size: 11px; color: #000000'><BR> <IMG SRC='error.gif' WIDTH=9 HEIGHT=9> " . $Message . "</DIV>"; echo "</BODY>"; echo "</HTML>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/236516-syntax-error-unexpected/#findComment-1215940 Share on other sites More sharing options...
kney Posted May 16, 2011 Share Posted May 16, 2011 I think it's because you create that variable "$OUs" in a for loop. Try putting this at the beginning of ur page, where you set ur $_GET variables... $OUs = ""; Quote Link to comment https://forums.phpfreaks.com/topic/236516-syntax-error-unexpected/#findComment-1215941 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.