• 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: include php

include php 3 weeks 4 days ago #44361

  • jhmaarts
  • jhmaarts's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
Hi,
I want to run a selfmade php script from the section Script called before the Admin Email is sent.
In what directory do I place the php file?
And what is the correct syntax to run this file?
The administrator has disabled public write access.

include php 1 week 1 day ago #44368

  • iceferret
  • iceferret's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 280
  • Thank you received: 74
I've never 'required' an external php file in rsform, just put the code directly into the section, for example to obfuscate passwords in emails
//function to obfusticate passwords in emails
$string = $userEmail['password'];
 
function star_replace($string){
    return preg_replace_callback('/[-\w]+/i', function($match){
       $arr = str_split($match[0]);
       $len = count($arr)-1;
       for($i=1;$i<$len;$i++) $arr[$i] = $arr[$i] == '-' ? '-' : '*';
       return implode($arr);
    }, $string);
 
}
$userEmail['password'] = star_replace($string);

however if you want to use an external file you could try placing your PHP file somewhere inside your Joomla website. For example:

/your-joomla-root/scripts/myscript.php

then in the Script called before the Admin Email section try
require_once JPATH_SITE . '/scripts/myscript.php';
If you can keep your head when all about you are losing theirs, you obviously don't understand the situation!
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!