www.webdeveloper.com
Results 1 to 5 of 5

Thread: Parse error:Parse error

  1. #1
    Join Date
    Mar 2011
    Posts
    5

    Post Parse error:Parse error

    Hi guys,

    I got Parse error: parse error in C:\wamp\www\xic\main_admin.php on line 174

    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');

    echo ('<SCRIPT LANGUAGE=JAVASCRIPT>
    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');
    }

    ?>

  2. #2
    Join Date
    Dec 2002
    Location
    St. Louis, MO, USA
    Posts
    1,582
    Is the error a JavaScript error, or a PHP error?

    Either way, do a "View Source" of your code from the browser, and go to that line; that should at least tell you WHERE the error is. Then it will be much easier to troubleshoot.

    CORRECTION: If it's a JavaScript error, the above should work. If it's a PHP error, then the line number mentioned in the error message already tells you WHERE the error is.

    ^_^

    PS. I just noticed that the action of your form is "install/". That's not a valid action. It needs an actual web document name.
    Last edited by WolfShade; 03-16-2011 at 08:47 AM.

  3. #3
    Join Date
    Mar 2011
    Posts
    5
    Thanks for your reply,

    I put at the top of my thread that it is in :Parse error: parse error in C:\wamp\www\testa\main.php on line 174

  4. #4
    Join Date
    Mar 2011
    Posts
    5
    actually if you copy the code to eclipse or any php editor you can see that there is a problems in "commas " I don't where exactly but parts of the code commented

  5. #5
    Join Date
    Dec 2002
    Location
    St. Louis, MO, USA
    Posts
    1,582
    Quote Originally Posted by alkhader View Post
    I put at the top of my thread that it is in :Parse error: parse error in C:\wamp\www\testa\main.php on line 174
    This only tells me (upon further reflection) that the issue is PHP, not JavaScript. The issue is in main.php on line 174. What is on line 174 of main.php?

    ^_^

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles