/    Sign up×
Community /Pin to ProfileBookmark

Parse error:Parse error

Hi guys,

I got Parse error: parse error in C:wampwwwxicmain.php on line 174
I think problem started at the line below with red color

please can you help me to find where is the error: this is my code :

<?php

include (‘config.php’);

include (‘jdf.php’);
$db=mysql_connect($dbhost, $dbuname, $dbpass);
mysql_select_db($dbname, $db);
$result=mysql_query(“select * from settings where id = ‘1’”, $db);

if (!$result)
{
include (‘language/english.php’);

echo (‘<html dir=”rtl”>’);

include (‘header.php’);

[B][COLOR=”Red”]echo (‘<SCRIPT LANGUAGE=JAVASCRIPT> [/COLOR][/B]
function dosubmit() {
document.forms[0].action = “index.php”
document.forms[0].method = “POST”
document.forms[0].submit()
</SCRIPT><script language=”JavaScript”>
<!–
function CheckForm(formID) {
if (formID.admin_id.value == “”) { alert(“‘ . _ADMIN_INSTALL_ENTER_USERNAME . ‘”);
formID.admin_id.focus(); return false; }
if (formID.password.value == “”) { alert(“‘ . _
ADMIN_INSTALL_ENTER_PASSWORD . ‘”);
formID.password.focus(); return false; }
if (formID.password_confirm.value == “”) { alert(“‘ . _ADMIN_INSTALL_ADD_USER_ENTER_CONFIRM_PASSWORD . ‘”);
formID.password_confirm.focus(); return false; }
if (formID.password_confirm.value !== formID.password.value) { alert(“‘ . _
ADMIN_INSTALL_ADD_USER_PASSWORD_AND_CONFIRM_NOT_MATCH . ‘”);
formID.password.focus(); return false; }
return true;
}
//–>
</script> ‘);
///////////////////////

echo (‘<br /><br /><br /><br /><form method=”POST” action=”install/” onSubmit=”return CheckForm(this);”><div align=”center”>
<table border=”1″ width=”600″ dir=”rtl”>
<tr>
<td width=”50″>
<p align=”center”><cebter><img src=”images/error_big.gif”></center></td>
<td><p align=”center” dir=”rtl”>
<font color=”#FFCC00″ face=”Tahoma” style=”font-size: 9pt”><b>’ . _TESTA_INSTALL_FARSI . ‘<span lang=”en-us”>.</span></b></font></p>
<p align=”center” dir=”ltr”><span lang=”en-us”>
<font color=”#FFCC00″ face=”Tahoma” style=”font-size: 9pt”><b>’ . _
TESTA_INSTALL_ENGLISH . ‘<br /><br />
<div align=”center”>
<table width=”500″ border=”1″ height=”118″ dir=”rtl”>
<tr>
<td align=”right” valign=”top”>
<p align=”right”><font style=”font-size: 9pt” face=”Tahoma”>’ . _ADMIN_ADMIN_USERNAME . ‘<font color=”#FF0000″ style=”font-size: 8pt”>*</font>:</font></td>
<td align=”right” valign=”top”><span dir=”ltr”><font face=”Tahoma”>
<span style=”font-size: 9pt”>
<input type=”text” name=”admin_id” value=”” dir=”ltr” size=”25″></span></font></span></td>
<td align=”right” width=”100″ valign=”top”>
<p align=”left”><font style=”font-size: 9pt” face=”Tahoma”>Admin Username<font color=”#FF0000″ style=”font-size: 8pt”></font></font></td>
</tr>
<tr>
<td align=”right” valign=”top”>
<p align=”right”><font style=”font-size: 9pt” face=”Tahoma”>’ .
_
ADMIN_ADD_USER_PASSWORD . ‘<font color=”#FF0000″ style=”font-size: 8pt”>*</font>:</font></td>
<td align=”right” valign=”top”><span dir=”ltr”><font face=”Tahoma”>
<span style=”font-size: 9pt”>
<input type=”password” name=”password” value=”” dir=”ltr” size=”25″></span></font></span></td>
<td align=”right” valign=”top”>
<p align=”left”><font style=”font-size: 9pt” face=”Tahoma”>Password<font color=”#FF0000″ style=”font-size: 8pt”></font></font></td>
</tr>
<tr>
<td align=”right” valign=”top”>
<p align=”right”><font style=”font-size: 9pt” face=”Tahoma”>’ . _ADMIN_ADD_USER_CONFIRM_PASSWORD . ‘<font color=”#FF0000″ style=”font-size: 8pt”>*</font>:</font></td>
<td align=”right” valign=”top”><span dir=”ltr”><font face=”Tahoma”>
<span style=”font-size: 9pt”>
<input type=”password” name=”password_confirm” value=”” dir=”ltr” size=”25″></span></font></span></td>
<td align=”right” valign=”top”>
<p align=”left”><font style=”font-size: 9pt” face=”Tahoma”>Confirm Password<font color=”#FF0000″ style=”font-size: 8pt”></font></font></td>
</tr>
<tr>
<td height=”31″>

<p align=”right”><font face=”Tahoma”><span style=”font-size: 9pt”>’ . _ADMIN_SETTINGS_LANGUAGE . ‘:</span></font></td>
<td height=”31″>

<p align=”center”><select dir=”ltr” size=”1″ name=”language”>’);
?>

<?
$dir=opendir(“language”);

while (false !== ($file=readdir($dir)))
{
if (strpos($file, ‘.php’, 1))
{
$rest=substr(“$file”, 0, -4);

if ($rest == $system_language)
echo (‘<option selected value=”‘ . $rest . ‘”>’ . $rest . ‘</option>’);
else
echo (‘<option value=”‘ . $rest . ‘”>’ . $rest . ‘</option>’);
}
}

closedir ($dir);

echo (‘</select></p></font></td>
<td align=”right” valign=”top”>
<p align=”left”><font style=”font-size: 9pt” face=”Tahoma”>Language<font color=”#FF0000″ style=”font-size: 8pt”></font></font></td>
</tr><tr>
<td height=”31″>
<p align=”right”><font face=”Tahoma”>
<span style=”font-size: 9pt”>’
. _ADMIN_SETTINGS_RTL . ‘:</span></font>
</td><td height=”31″>
<font style=”font-size: 9pt” face=”Tahoma”><input type=”radio” value=”1″ checked name=”rtl”>’
. _
ADMIN_SYSTEM_ALERT_RTL_RTL . ‘
<span lang=”fa”>&nbsp;
<input type=”radio” name=”rtl” value=”0″>’ . _ADMIN_SYSTEM_ALERT_RTL_LTR
. ‘ </span></font></td>
<td align=”right” valign=”top”>
<p align=”left”><font style=”font-size: 9pt” face=”Tahoma”>Alignment<font color=”#FF0000″ style=”font-size: 8pt”></font></font></td>

</tr><tr>
<td colspan=”3″ valign=”bottom” height=”38″>
<p align=”center”><font face=”Tahoma”><span style=”font-size: 9pt”><input type=”submit” value=”Install Testa” name=”B1″></span></font></p>
</td></tr></table>
</div><br /></td>
</tr>
</table>
</div>
</form>
‘);

die();
//////////////End form

}
else
{
$rec=mysql_fetch_row($result);
$system_language=$rec[3];
include (‘language/’ . $rec[3] . ‘.php’);

if ($rec[4] == 1)
echo (‘<html dir=”rtl”>’);
else
echo (‘<html>’);
$result_rtl=mysql_query(“select * from settings where id = ‘1’”, $db);
$rtl_array=mysql_fetch_row($result_rtl);

if ($rtl_array[4] == 1)
{
$system_align=$align=”right”;
$system_rtl_input=$rtl_input=”rtl”;
}
else
{
$system_align=$align=”left”;
$system_rtl_input=$rtl_input=”ltr”;
}
include (‘header.php’);
}

?>

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@hastxMar 16.2011 — is the code pasted the actual file 'main.php'? And is the red code line 174 of the file?

You might want to use the appropriate 'code' or 'php' block tags when posting code like that. it is very difficult to follow the code without the syntax highlighting.
Copy linkTweet thisAlerts:
@alkhaderauthorMar 16.2011 — Hi hastx,

Thanks for your reply,

you are right about the code, The problem in this block of code.

<?php

[COLOR="Red"][B]echo ('<SCRIPT LANGUAGE=JAVASCRIPT>[/B][/COLOR]

function dosubmit() {

document.forms[0].action = "index.php"

document.forms[0].method = "POST"

document.forms[0].submit()

</SCRIPT><script language="JavaScript">

<!--

function CheckForm(formID) {

if (formID.admin_id.value == "") { alert("' . _ADMIN_INSTALL_ENTER_USERNAME . '");

formID.admin_id.focus(); return false; }

if (formID.password.value == "") { alert("' . _
ADMIN_INSTALL_ENTER_PASSWORD . '");

formID.password.focus(); return false; }

if (formID.password_confirm.value == "") { alert("' . _ADMIN_INSTALL_ADD_USER_ENTER_CONFIRM_PASSWORD . '");

formID.password_confirm.focus(); return false; }

if (formID.password_confirm.value !== formID.password.value) { alert("' . _
ADMIN_INSTALL_ADD_USER_PASSWORD_AND_CONFIRM_NOT_MATCH . '");

formID.password.focus(); return false; }

return true;

}

//-->

</script> ');
Copy linkTweet thisAlerts:
@tracknutMar 16.2011 — I would assume your error is the use of single quotes in your alert calls. They are closing your echo statement that you're hoping encompasses that complete block of code. Escaping them (') is probably the easiest solution.

Oh wait, I may have misread... ?

Dave
Copy linkTweet thisAlerts:
@OctoberWindMar 17.2011 — I would suggest stepping completely out of the PHP code block if you are going to be outputting a large js block. It'll just get too confusing, otherwise.

That, or look into heredoc syntax.
×

Success!

Help @alkhader spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...