Form Tools
How to access data with PHP? - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: Installation (https://forums.formtools.org/forumdisplay.php?fid=4)
+--- Thread: How to access data with PHP? (/showthread.php?tid=25933)



How to access data with PHP? - Polkafest - Jun 27th, 2017

I created some forms with the fabulous tool, but now I am stuck in trying to show the information on my webpage.

I added the "require" funciton , and copied / modified the provided example, but I am missing something. 
I tried to login as client and as admin first, but the error I always get, is a GET error :-)

Error message:
database_queries.php:1 GET http://xxxxxxxx.nl/test/database_queries.php 500 (Internal Server Error)

If this is already covered in another post, I appoligize, please direct me to it.

I created an export function, 

This is my Smarty Template
{$location_name} in {location_place}

This is my PHP code (I commented some code that I used for testing):
 

<?php

require("http://xxxxxxx.nl/formtools/global/api/api.php");

/* login as client ?
$account_info = array(
  "username" => "polkafest",
  "password" => " :-) "
);
list ($success, $message) = ft_api_login($account_info);
*/

/* login as admin?
$account_info = array(
  "username" => " :-)  ",
  "password" => "  :-)   "
);
list ($success, $message) = ft_api_login($account_info);
*/

$page = ft_api_load_field("page", "page", 1);
ft_api_show_submissions(2, 3 , 5, $page);


RE: How to access data with PHP? found solution - Polkafest - Jun 27th, 2017

As it was mentioned somewhere that it only worked on the site itself, I changed http://xxxxx finally to

require("../formtools/global/api/api.php"); 

 require  ../ and it s !