include('index.php') not working external script
Permalink
Hey guys,
I've been trying stuff for hours, I haven't found a good answer anywhere.
I have a payment page, after a successful payment I want to add the customer to my membership website, build with Concrete5.
The payment page is created with an external script, so I need to be able to add users from that script, using the Concrete5 functions.
I found that I needed to add this to be able to use Concrete5 code in the external script, but it doesn't work.
This is the structure of my folders and files:
root/
index.php
/folder
external.php
After the obvious tries, index.php still didn't load, now I have this:
Now I don't get any more errors, however, everything after 'include('../index.php');' doesn't load. That's why I added 'echo 'check 2';' to see if everything works.
I want to know what I'm doing wrong. Why doesn't it load? I tried to load a different php file with a simple echo in it and it showed up no problem.
To add a user I use this code:
I tested this out, it should work if it would load.
I've been trying stuff for hours, I haven't found a good answer anywhere.
I have a payment page, after a successful payment I want to add the customer to my membership website, build with Concrete5.
The payment page is created with an external script, so I need to be able to add users from that script, using the Concrete5 functions.
I found that I needed to add this to be able to use Concrete5 code in the external script, but it doesn't work.
<?define('C5_ENVIRONMENT_ONLY', true); include('index.php'); ?>
This is the structure of my folders and files:
root/
index.php
/folder
external.php
After the obvious tries, index.php still didn't load, now I have this:
Now I don't get any more errors, however, everything after 'include('../index.php');' doesn't load. That's why I added 'echo 'check 2';' to see if everything works.
I want to know what I'm doing wrong. Why doesn't it load? I tried to load a different php file with a simple echo in it and it showed up no problem.
To add a user I use this code:
<? use Concrete\Core\User\UserInfo; $user = \UserInfo::add(['uName' => 'andrafew', 'uEmail' => 'andrew@concrete5.org', 'uPassword' => 'kittens']); ?>
I tested this out, it should work if it would load.
In application/config/app.php, I have:
In application\controllers\frontend\api.php, I have:
The register() function can then be called via the slideshow/api/register URL.