Willkommen, Gast
  • Seite:
  • 1
  • 2

THEMA: Parse error: syntax error, unexpected T_STRING in

Parse error: syntax error, unexpected T_STRING in 3 Jahre 4 Monate her #68192

  • lxp
  • lxps Avatar
  • OFFLINE
  • Junior Boarder
  • Beiträge: 21
  • Karma: 0
Hi all,

I'm getting an error message at the beginning of my form like this:

Parse error: syntax error, unexpected T_STRING in facileforms.process.php(1052) : eval()'d code on line 11

Line 11 simply reads: global $mainframe;

Can someone tell me what I'm overlooking? BTW, the form works just fine, just displays this error code. Thanks!

LP
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Parse error: syntax error, unexpected T_STRING in 3 Jahre 4 Monate her #68396

  • TheMuffinMan
  • TheMuffinMans Avatar
  • OFFLINE
  • Moderator
  • Beiträge: 6604
  • Dank erhalten: 444
  • Karma: 104
Hi,

it seems you are using some custom php pieces. I guess in a before form piece.
Could you please post me that code? Then I can have a look what is wrong with it.

Regards,
Markus
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
Follow us on Twitter
===============================================
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Parse error: syntax error, unexpected T_STRING in 3 Jahre 4 Monate her #68400

  • lxp
  • lxps Avatar
  • OFFLINE
  • Junior Boarder
  • Beiträge: 21
  • Karma: 0
Hi Markus,

Here's the begin form piece. Thanks!!!!!!!

LP

// Create the user
global $mainframe;
JFactory::getLanguage()->load('com_user');
$db = JFactory::getDBO();
$db->setQuery("Select * From #__facileforms_records Where name = ".$db->Quote($this->formrow->name).");
$list = $db->loadObjectList();
$listSize = count($list);

for($i = 0; $i < $listSize;$i++)
{
$db->setQuery("Select * From #__users Where id = ".$db->Quote($list[$i]->user_id)." And block = 1");
$userResult = $db->loadObjectList();
if(count($userResult) == 1)
{
$db->setQuery("Update #__users Set block = 0 Where id = ".$db->Quote($userResult[0]->id)."");
$db->query();
$usersConfig = &JComponentHelper::getParams( 'com_users' );
$sitename = $mainframe->getCfg( 'sitename' );
$useractivation = $usersConfig->get( 'useractivation' );
$mailfrom = $mainframe->getCfg( 'mailfrom' );
$fromname = $mainframe->getCfg( 'fromname' );
$siteURL = JURI::base();
$subject = sprintf ( JText::_( 'Account details for' ), $userResult[0]->name, $sitename);
$subject = html_entity_decode($subject, ENT_QUOTES);
$message = sprintf ( JText::_( 'SEND_MSG' ), $userResult[0]->name, $sitename, $siteURL);
$message = html_entity_decode($message, ENT_QUOTES);

//get all super administrator
$query = 'SELECT name, email, sendEmail' . ' FROM #__users' . ' WHERE LOWER( usertype ) = "super administrator"';
$db->setQuery( $query );
$rows = $db->loadObjectList();

// Send email to user
if ( ! $mailfrom || ! $fromname )
{
$fromname = $rows[0]->name;
$mailfrom = $rows[0]->email;
} //end if

JUtility::sendMail($mailfrom, $fromname, $userResult[0]->email, $subject, $message);

// Send notification to all administrators
$subject2 = sprintf ( JText::_( 'Account details for' ), $name, $sitename);
$subject2 = html_entity_decode($subject2, ENT_QUOTES);

// get superadministrators id
foreach ( $rows as $row )
{
if ($row->sendEmail)
{
$message2 = sprintf ( JText::_( 'SEND_MSG_ADMIN' ), $row->name, $sitename, $userResult[0]->name, $userResult[0]->email,

$userResult[0]->username);
$message2 = html_entity_decode($message2, ENT_QUOTES);
JUtility::sendMail($mailfrom, $fromname, $row->email, $subject2, $message2);
} // end if
} // end foreach
} // end if
} // end Create User
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Parse error: syntax error, unexpected T_STRING in 3 Jahre 4 Monate her #68424

  • lxp
  • lxps Avatar
  • OFFLINE
  • Junior Boarder
  • Beiträge: 21
  • Karma: 0
Hi Markus,

I removed the begin script and the error has disappeared. However, now the new end script (see below) doesn't bind the custtype or create the user as registered. Any ideas? Thanks!

LP

// Create User - End Submit Piece
// Requires
// Begin create user
global $mainframe;
JFactory::getLanguage()->load('com_user');
$this->execPieceByName('ff_InitLib');
$user = clone(JFactory::getUser());
$pathway =& $mainframe->getPathway();
$config =& JFactory::getConfig();
$authorize =& JFactory::getACL();
$document =& JFactory::getDocument();

// If user registration is not allowed, show 403 not authorized.
$usersConfig = &JComponentHelper::getParams( 'com_users' );
if ($usersConfig->get('allowUserRegistration') == '0') {
echo '<script>alert("Access forbidden");history.go(-1);</script>';
return;
} else {

// Initialize new usertype setting
$newUsertype = $usersConfig->get( 'new_usertype' );
if (!$newUsertype) {
$newUsertype = 'Registered';
}

// Bind the post array to the user object
$post = array(
'name' => ff_getSubmit('first_name'),
'username' => ff_getSubmit('e_mail'),
'email' => ff_getSubmit('e_mail'),
'password' => ff_getSubmit('password'),
'password2' => ff_getSubmit('password'),
'custtype' => ff_getSubmit('custtype'),
'task' => 'register_save',
'id' => '0',
'gid' => '0',
);

if (!$user->bind( $post, 'usertype' )) {
echo '<script>alert("'.addslashes($user->getError()).'");history.go(-1);</script>';
return;
} else {

// Set some initial user values
$user->set('id', 0);
$user->set('usertype', '');
$user->set('gid', $authorize->get_group_id( '', $newUsertype, 'ARO' ));

$date =& JFactory::getDate();
$user->set('registerDate', $date->toMySQL());

// If user activation is turned on, we need to set the activation information
$useractivation = $usersConfig->get( 'useractivation' );
if ($useractivation == '1')
{
jimport('joomla.user.helper');
$user->set('activation', JUtility::getHash( JUserHelper::genRandomPassword()) );
$user->set('block', '1');
}

// If there was an error with registration, set the message and display form
if ( !$user->save() )
{
echo '<script>alert("'.addslashes(JText::_( $user->getError())).'");history.go(-1);</script>';
return;
} else {

$db =& JFactory::getDBO();

$name = $user->get('name');
$email = $user->get('email');
$username = $user->get('username');

JFactory::getDBO()->setQuery("Update #__facileforms_records Set user_id = '".$user->get('id')."',

username = ".JFactory::getDBO()->Quote($username).", user_full_name = ".JFactory::getDBO()->Quote($name)." Where id = '".$this->record_id."'");
JFactory::getDBO()->query();
}

}

}


// Load BF Library
$this->execPieceByName('ff_InitLib');
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Parse error: syntax error, unexpected T_STRING in 3 Jahre 4 Monate her #68621

  • TheMuffinMan
  • TheMuffinMans Avatar
  • OFFLINE
  • Moderator
  • Beiträge: 6604
  • Dank erhalten: 444
  • Karma: 104
Hi,

please revert the old code but change this line

$db->setQuery("Select * From #__facileforms_records Where name = ".$db->Quote($this->formrow->name).");

to this

$db->setQuery("Select * From #__facileforms_records Where name = ".$db->Quote($this->formrow->name));

This was the line where the error appeared.

Maybe everything will work then as expected.

Regards,
Markus
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
Follow us on Twitter
===============================================
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Parse error: syntax error, unexpected T_STRING in 3 Jahre 4 Monate her #68726

  • lxp
  • lxps Avatar
  • OFFLINE
  • Junior Boarder
  • Beiträge: 21
  • Karma: 0
Sheer genius! YOU DA MAN!!!! Thanks Markus
Der Administrator hat öffentliche Schreibrechte deaktiviert.
  • Seite:
  • 1
  • 2
Ladezeit der Seite: 0.226 Sekunden

Flatrate-Mitgliedschaft

Unbegrenzter Zugang zu allen aktuellen und kommenden Produkten von Crosstec inkl.Support -- für nur $119 USD.

Die Flatrate-Mitgliedschaft beinhaltet zeitlich unbegrenzten Zugang zu allen von uns angebotenen Produkten, d.h. alle Joomla! Extensions, Jooml! Templates, WordPress Plugins, WordPress Themes. + 24 Monate Support   es ist alles dabei und Sie können sofort loslegen!

Hier geht's zur Bestellung

Crosstec hilft sparen!

Falls Sie neu bei Crosstec sind aber bereits einen Formulargenerator bei einem anderen Hersteller gekauft haben, dann bekommen sie von uns einen Rabatt von 25% auf unsere 1-Jahres und Flatrate-Mitgliedschaften

Wie Sie an den Rabatt kommen?

Schreiben Sie uns einfach eine kurze Email mit beigelegten Kaufbeleg (z.B. PayPal Quittung) an sales@crosstec.org.

Wir unterstützen die Joomla Community

Crosstec unterstützt weltweit alle offiziellen Joomla! User Groups und Organisatoren von Joomla! Days die bei Joomla.org registriert sind.

Falls das auf dich zutrifft und du eines unserer Produkte brauchst, schreib uns eine kurze Email an info@crosstec.org und du bekommst eine Flatrate-Mitgliedschaft geschenkt!

Live Chat Software