Forum Moderators: coopster
I have unexpected error in code
--------------------------------------------------------------
<?php
/*
$Id: shipping.php,v 1.4 2002/11/19 01:48:08 dgw_ Exp $ osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2002 osCommerce
Released under the GNU General Public License
*/
define('NAVBAR_TITLE', 'E-novice - mailing list');
define('HEADING_TITLE', '<br>E-novice - mailing list');
define('TEXT_N_SPLOSNO', '');
define('TEXT_SPLOSNO', '<script language="Javascript" type="text/javascript">
var fieldstocheck = new Array();
fieldnames = new Array();
function checkform() {
for (i=0;i<fieldstocheck.length;i++) {
if (eval("document.subscribeform.elements['"+fieldstocheck[i]+"'].value") == "")
{
alert("Prosimo vnesite "+fieldnames[i]);
eval("document.subscribeform.elements['"+fieldstocheck[i]+"'].focus()");
return false;
}
}
return true;
}
function addFieldToCheck(value,name) {
fieldstocheck[fieldstocheck.length] = value;
fieldnames[fieldnames.length] = name;
}
function compareEmail()
{
return (document.subscribeform.elements["email"].value == document.subscribeform.elements["emailconfirm"].value);
}
</script>
obvously it is Oscommerce file :)
error says
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/web/domain.com/www/includes/languages/slovenian/mail_prijava.php on line 22
i'm no programer or coder .. but i'm trying some things :D
thanx in advance!
if (eval("document.subscribeform.elements['"+fieldstocheck[i]+"'].value") == "")
{
alert("Prosimo vnesite "+fieldnames[i]);
eval("document.subscribeform.elements['"+fieldstocheck[i]+"'].focus()");
Those single quotes are getting you. They need to be escaped like so:
elements[\'"+fieldstocheck[i]+"\']
But honestly, I would first try removing them all together. If that breaks it then put them back and escape them.