Call PHP script exernally in Fabrik Forms

ritesh123

Member
Hi All

As we all know, PDF output doesn't work properly in Joomla and Fabrik.
I have added a HTML Form Script on top of Joomla Form using form Plugin ( get Top Content)

<form action="script1_pdf.php" method="POST">
<table border="0" width="100%">
<tr>
<td align="right"><input type="submit" name="submit" value="PDF"> </td>
</tr>
</table>
</form>

When i am clicking/calling the PDF button it is showing Restricted Access.
How can i call a external PHP within Fabrik Form?
 
Sounds like some kind of htaccess controls on your server. Try being more specific about the location of the action, give it a full path. And make sure access to that location is not restricted by any htaccess rules.

-- hugh
 
Hi

I am using this on top of Fabrik Form using Form Plugin ( Php)- get Top Content

the php file is located at root of the server www.

Where should i keep this file to utilize joomla functions like "$db =&JFactory::getDBO();"

I am not able to access the file script1_pdf.php, because this file contains line

<?php
defined('_JEXEC') or die( 'Restricted access' );
?>
 
Not knowing what the script1_pdf.php does, it's hard to answer that one. But that JEXEC test is common to all J! files, and basically checks to see that the file is being loaded as part of the J! "framework" rather than a standalone file. So if your script is designed to run standalone, and not as part of a normal J! page load, then it wouldn't want those lines at the start.

-- hugh
 
As we all know, PDF output doesn't work properly in Joomla and Fabrik.
Did you try a recent GitHub update? PDF should be working now.
Fabrik Form using Form Plugin...
Where should i keep this file to utilize joomla functions like "$db =&JFactory::getDBO();"
If you are running the script inside Fabrik it's inside Joomla, too and "defined('_JEXEC') or die( 'Restricted access' );" should not hurt, but your server may restrict access to php-files on "unusual" places.

You can't use things like JFactory:: outside of Joomla.

So what are you trying to do where?
 
Hi

I am using my own PDF button, as i dont want to use DOMpdf, I am using mPDF

Please see below my complete steps

1. I have a Fabrik Form, I am using its PHP Plugin ( get Top Content), where i have this below code for PDF button

<form action="script.php" method="POST">
<table border="0" width="100%">
<tr>
<td align="right"><input type="submit" name="submit" value="PDF"> </td>
</tr>
</table>
</form>

2. I created a folder in the components
com_script

Which is having a file script.php inside this component folder

3. When i click the PDF button, it executes the script.php file ( which is working now, thats why created this thread as how to call PHP scripts externally). Now ran into new issue

4. In this script.php file i have mPDF related code. When i running this script, it is telling me

"Sorry this form is not published"

But the form is actually published and i can see the form in the Create View and Detail View

How to solve this matter this Form is not published?
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top