• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: insert information in hidden field

insert information in hidden field 9 years 11 months ago #31318

  • celine
  • celine's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 19
hello
i try to insert 4 informations in hidden field but nothing in email
context : 1 page with with form that sending an email to administrator witth specific information
1 title of page i create an hidden field with
<code>
$doc = JFactory::getDocument();
return $doc->getTitle();
</code>
2 url of article i create an hidden field with
<code>
$url = RSFormProHelper::getURL();
return $url;
</code>
3 email of author page i create an hidden field with
<code>
  // Get a database connection.
  $db = JFactory::getDbo();
 
  // Get the current article ID from the URL.
  $articleId   = JRequest::getInt('id');
 
  // Setup the query.
  $db->setQuery("SELECT created_by FROM #__content WHERE `id`='".$db->escape($articleId)."'");
  $createdBy = $db->loadResult();
  if ($createdBy) {
    // Get the user based on the created_by column value.
    $user = JFactory::getUser($createdBy);
 
    // Return the email address.
    return $user->get('email');
  }
 </code>
4 name of author i create an hidden field with
<code>
  // Get a database connection.
  $db = JFactory::getDbo();
 
  // Get the current article ID from the URL.
  $articleId   = JRequest::getInt('id');
 
  // Setup the query.
  $db->setQuery("SELECT created_by FROM #__content WHERE `id`='".$db->escape($articleId)."'");
  $createdBy = $db->loadResult();
  if ($createdBy) {
    // Get the user based on the created_by column value.
    $user = JFactory::getUser($createdBy);
 
    // Return the email address.
    return $user->get('name');
  }
  </code>

but nothing work ... that strange
thanks for any help
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!