# Import from PDF into forms

**URL:** <https://community.open-emr.org/t/import-from-pdf-into-forms/7953>\
**Category:** OpenEMR Development\
**Created:** [May 24, 2016, 9:17pm UTC](https://community.open-emr.org/t/import-from-pdf-into-forms/7953 "2016-05-24T21:17:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [May 24, 2016, 9:17pm UTC](https://community.open-emr.org/t/import-from-pdf-into-forms/7953/1 "2016-05-24T21:17:09Z")

</div>

**[noscrodamus](https://sourceforge.net/u/noscrodamus/)** wrote on [Tuesday, May 24, 2016](https://sourceforge.net/p/openemr/discussion/202506/thread/0ed14210/#694a):

Attempting to send data from PDF using POST to save.php file.  
Manually setting the SESSION ID and PID, but still receiving “Site ID is missing from session data!” error upon submission.  
I have hidden the values for SESSION site\_id and pid on the pdf and pass those values to save.php.

This is at the top of save.php:

```auto
print_r($_SESSION);
print_r($_POST);
$_SESSION['site_id']=$_POST['site_id'];
$_SESSION['pid']=$_POST['pid'];

```

What am I missing?

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [May 24, 2016, 11:01pm UTC](https://community.open-emr.org/t/import-from-pdf-into-forms/7953/2 "2016-05-24T23:01:54Z")

</div>

**[mdsupport](https://sourceforge.net/u/mdsupport/)** wrote on [Tuesday, May 24, 2016](https://sourceforge.net/p/openemr/discussion/202506/thread/0ed14210/#75e0):

Search this forum for “Site ID is missing”.

One of the hits will be [this thread](https://sourceforge.net/p/openemr/discussion/202505/thread/36cbdf6f/).

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [May 25, 2016, 2:35am UTC](https://community.open-emr.org/t/import-from-pdf-into-forms/7953/3 "2016-05-25T02:35:09Z")

</div>

**[noscrodamus](https://sourceforge.net/u/noscrodamus/)** wrote on [Wednesday, May 25, 2016](https://sourceforge.net/p/openemr/discussion/202506/thread/0ed14210/#75e0/cfbd):

Thank you for the link.  
The majority of ‘Site ID missing’ cases were install related, I am trying to add functionality.

The forms are downloaded from the Native Patient portal and currently have these values in the SESSION array:

```auto
Array ( [site_id] => default [language_choice] => 1 [language_direction] => ltr [portal_username] => EHAB4 [pid] => 3 [patient_portal_onsite] => 1 ) 

```

are these enough? I would consider dev. consulting if the issue proves too troublesome.

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [May 25, 2016, 2:52am UTC](https://community.open-emr.org/t/import-from-pdf-into-forms/7953/4 "2016-05-25T02:52:28Z")

</div>

**[teryhill](https://sourceforge.net/u/teryhill/)** wrote on [Wednesday, May 25, 2016](https://sourceforge.net/p/openemr/discussion/202506/thread/0ed14210/#75e0/cfbd/1883):

Are you including verify. php? Look at some of the other code like for the documents in the portal. I am away from my computer and may have an incomplete file name. The session information is set in that program.

Terry

Sent from my iPhone

> On May 24, 2016, at 10:35 PM, Noscrodamus [noscrodamus@users.sf.net](mailto:noscrodamus@users.sf.net) wrote:
> 
> Thank you for the link.  
> The majority of ‘Site ID missing’ cases were install related, I am trying to add functionality.
> 
> The forms are downloaded from the Native Patient portal and currently have these values in the SESSION array:
> 
> ```auto
> Array ( [site_id] => default [language_choice] => 1 [language_direction] => ltr [portal_username] => EHAB4 [pid] => 3 [patient_portal_onsite] => 1 ) 
> 
> ```
> 
> are these enough? I would consider dev. consulting if the issue proves too troublesome.
> 
> * * *
> 
> [Import from PDF into forms](https://sourceforge.net/p/openemr/discussion/202506/thread/0ed14210/?limit=25#75e0/cfbd)
> 
> * * *
> 
> Sent from [sourceforge.net](http://sourceforge.net) because you indicated interest in [https://sourceforge.net/p/openemr/discussion/202506/](https://sourceforge.net/p/openemr/discussion/202506/)
> 
> To unsubscribe from further messages, please visit [https://sourceforge.net/auth/subscriptions/](https://sourceforge.net/auth/subscriptions/)

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [May 25, 2016, 3:40am UTC](https://community.open-emr.org/t/import-from-pdf-into-forms/7953/5 "2016-05-25T03:40:38Z")

</div>

**[noscrodamus](https://sourceforge.net/u/noscrodamus/)** wrote on [Wednesday, May 25, 2016](https://sourceforge.net/p/openemr/discussion/202506/thread/0ed14210/#75e0/cfbd/1883/b5b9):

I have tried with and without verify\_session.php.  
It takes me back to the $landingpage  
Here is the top of save.php

```auto
require_once('../../globals.php');
print_r($_SESSION);
print_r($_POST);
$_SESSION['site_id']=$_POST['site_id'];
$_GET['site_id']=$_POST['site_id'];
$_SESSION['pid']=$_POST['pid'];
require_once($GLOBALS['srcdir'].'/api.inc');
require_once("/var/www/html/openemr/patients/verify_session.php");
/* for ??? */
require_once($GLOBALS['srcdir'].'/forms.inc');
/* for formDataCore() */
require_once($GLOBALS['srcdir'].'/formdata.inc.php');

```

Are there any logs I can look at to see why this isnt working?

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [May 25, 2016, 4:25pm UTC](https://community.open-emr.org/t/import-from-pdf-into-forms/7953/6 "2016-05-25T16:25:26Z")

</div>

**[noscrodamus](https://sourceforge.net/u/noscrodamus/)** wrote on [Wednesday, May 25, 2016](https://sourceforge.net/p/openemr/discussion/202506/thread/0ed14210/#b43a):

I am checking the interaction between view.php and save.php. It does not seem like any session data is being passed to save.php. Is this correct?

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [May 26, 2016, 5:57am UTC](https://community.open-emr.org/t/import-from-pdf-into-forms/7953/7 "2016-05-26T05:57:38Z")

</div>

**[visolveemr](https://sourceforge.net/u/visolveemr/)** wrote on [Thursday, May 26, 2016](https://sourceforge.net/p/openemr/discussion/202506/thread/0ed14210/#bdbf):

Session data will be passed from the globals.php.

Try adding the following lines at the top of the save.php, just above “require\_once(’…/…/globals.php’);” this line.

$fake\_register\_globals=false;  
$sanitize\_all\_escapes=true;  
$ignoreAuth=true;

In case you face further issues, let us know the exact scenarios and the file locations.

_Thanks  
OpenEMR Customization/Support Team,  
 [ViSolve Inc](http://www.visolve.com/)_

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [May 26, 2016, 3:14pm UTC](https://community.open-emr.org/t/import-from-pdf-into-forms/7953/8 "2016-05-26T15:14:11Z")

</div>

**[noscrodamus](https://sourceforge.net/u/noscrodamus/)** wrote on [Thursday, May 26, 2016](https://sourceforge.net/p/openemr/discussion/202506/thread/0ed14210/#bdbf/74ef):

I feel silly, I set everything back to defaults and new.php and view.php are indeed sending SESSION and GET data to save.php.

Using your soution, I get an invalid server response on adobe acrobat pro. I am sending the data as POST and it is capable of connecting to the server and returning output. I have tested using a `print_r($POST);` script

Any idea of how to get around this? Also, what data is absolutely necessary to be passed to the server to make this work? Thank you!
