POST Variables and tools files
I want to pass data from a form to a php script within the /tools directory.
I don't want to create a single page I just want to POST some form variables from a page outside of Concrete5 for example:
then my code can do what it needs to do with the POSTed variables.
However, when I submit the form the POSTed variables are stripped out along the way somewhere.
for example if I have in my form a field named 'test'.
in /tools/myfile.php I add echo $_POST['test'] - I get nothing.
What am I missing here? I want to be able to leverage the API but cannot get the POST to work. If I submit the form directly to the tools file without going via index.php the variables are there.
I must be doing something very basic wrong...
I want to be able to access the tool file from a pahe that is outside the Concrete5 website - that being the case I won't have access to the method.
I tried a GET and that seems to work ok - I guess because of the way the GET mechanism works...
Is that the case then - you cannot POST from a file outside of Concrete5 to a tools file to run a routine?
How exactly are you sending the form data? Are you using the jquery Ajax form library?
Note that there is no ".php" at the end of the filename (so if your tools file is called "myawesomefile.php", the tools URL is "http://yoursite.com/index.php/tools/myawesomefile").
And note that I tested this in the site's top-level "tools" directory -- it might need a different URL if you're doing this from within a package.
* Post the actual tools file you're using (ZIP it up so the forum will let it be posted)
* Say *exactly* what directory you have it in on your server
* Post the form html you have on the external site.
Using $.get or method="get" in your form will send the data to $_GET, not $_POST.
But you're absolutely right that $_REQUEST will always work for everything ($_GET and $_POST and even $_COOKIE), so might as well keep doing what you're doing.
I dont' know the inner workings of why, I just know that $_POST sucks. lol
 Just an afterthought, I think I used the jQuery load() request for all these. Maybe that is the trick.